<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Is it possible to export avro files from Hadoop to Teradata with Sqoop? And if ‘yes’, how? in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Is-it-possible-to-export-avro-files-from-Hadoop-to-Teradata/m-p/163745#M53614</link>
    <description>&lt;P&gt;Interesting question, I should try it out. That said if you can't figure out on your own or won't get other responses, then try creating a hive schema on top of your avro files, then run the following statement in hive to create a new table in orc or text format from your original avro table. Then you should be able to find examples of exporting with sqoop from orc or text&lt;/P&gt;&lt;PRE&gt;create table newtable as select * from avrotable&lt;/PRE&gt;
&lt;PRE&gt;--sample avro backed hive table

CREATE DATABASE DEMO;
USE DEMO;
CREATE EXTERNAL TABLE mailinglist
  COMMENT "just drop the schema right into the HQL"
  ROW FORMAT SERDE
  'org.apache.hadoop.hive.serde2.avro.AvroSerDe'
  STORED AS INPUTFORMAT
  'org.apache.hadoop.hive.ql.io.avro.AvroContainerInputFormat'
  OUTPUTFORMAT
  'org.apache.hadoop.hive.ql.io.avro.AvroContainerOutputFormat'
  LOCATION '/tmp/rdbms'
  TBLPROPERTIES (
    'avro.schema.literal'='{
      "type": "record",
      "name": "mailinglist",
      "namespace": "any.data",
      "fields": [
        {
          "name": "id",
          "type": [
            "null",
            "int"
          ]
        },
        {
          "name": "first_name",
          "type": [
            "null",
            "string"
          ]
        },
        {
          "name": "last_name",
          "type": [
            "null",
            "string"
          ]
        },
        {
          "name": "email",
          "type": [
            "null",
            "string"
          ]
        },
        {
          "name": "gender",
          "type": [
            "null",
            "string"
          ]
        }
      ]
    }');&lt;/PRE&gt;</description>
    <pubDate>Wed, 08 Feb 2017 10:52:11 GMT</pubDate>
    <dc:creator>aervits</dc:creator>
    <dc:date>2017-02-08T10:52:11Z</dc:date>
    <item>
      <title>Is it possible to export avro files from Hadoop to Teradata with Sqoop? And if ‘yes’, how?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Is-it-possible-to-export-avro-files-from-Hadoop-to-Teradata/m-p/163744#M53613</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;I’m asking this way because
we imported data from Teradata to HDFS with Sqoop. I found many examples in the
internet how to do it. It works an everything seems to be ok. I used the –as-avrodatafile
command and also know where to find the .avsc file.&lt;/P&gt;&lt;P&gt;But now I am trying to
export the same data back to my Teradata Table. I found many examples how to
use the export in Sqoop to export .csv files. I was successful in exporting these
files to teradata. But I couldn’t find anywhere how you can do it if you have
avro files.&lt;/P&gt;&lt;P&gt;Can anyone give me some
help, for example a link to a tutorial or a code example? &lt;/P&gt;</description>
      <pubDate>Tue, 07 Feb 2017 18:45:08 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Is-it-possible-to-export-avro-files-from-Hadoop-to-Teradata/m-p/163744#M53613</guid>
      <dc:creator>rfluck</dc:creator>
      <dc:date>2017-02-07T18:45:08Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to export avro files from Hadoop to Teradata with Sqoop? And if ‘yes’, how?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Is-it-possible-to-export-avro-files-from-Hadoop-to-Teradata/m-p/163745#M53614</link>
      <description>&lt;P&gt;Interesting question, I should try it out. That said if you can't figure out on your own or won't get other responses, then try creating a hive schema on top of your avro files, then run the following statement in hive to create a new table in orc or text format from your original avro table. Then you should be able to find examples of exporting with sqoop from orc or text&lt;/P&gt;&lt;PRE&gt;create table newtable as select * from avrotable&lt;/PRE&gt;
&lt;PRE&gt;--sample avro backed hive table

CREATE DATABASE DEMO;
USE DEMO;
CREATE EXTERNAL TABLE mailinglist
  COMMENT "just drop the schema right into the HQL"
  ROW FORMAT SERDE
  'org.apache.hadoop.hive.serde2.avro.AvroSerDe'
  STORED AS INPUTFORMAT
  'org.apache.hadoop.hive.ql.io.avro.AvroContainerInputFormat'
  OUTPUTFORMAT
  'org.apache.hadoop.hive.ql.io.avro.AvroContainerOutputFormat'
  LOCATION '/tmp/rdbms'
  TBLPROPERTIES (
    'avro.schema.literal'='{
      "type": "record",
      "name": "mailinglist",
      "namespace": "any.data",
      "fields": [
        {
          "name": "id",
          "type": [
            "null",
            "int"
          ]
        },
        {
          "name": "first_name",
          "type": [
            "null",
            "string"
          ]
        },
        {
          "name": "last_name",
          "type": [
            "null",
            "string"
          ]
        },
        {
          "name": "email",
          "type": [
            "null",
            "string"
          ]
        },
        {
          "name": "gender",
          "type": [
            "null",
            "string"
          ]
        }
      ]
    }');&lt;/PRE&gt;</description>
      <pubDate>Wed, 08 Feb 2017 10:52:11 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Is-it-possible-to-export-avro-files-from-Hadoop-to-Teradata/m-p/163745#M53614</guid>
      <dc:creator>aervits</dc:creator>
      <dc:date>2017-02-08T10:52:11Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to export avro files from Hadoop to Teradata with Sqoop? And if ‘yes’, how?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Is-it-possible-to-export-avro-files-from-Hadoop-to-Teradata/m-p/163746#M53615</link>
      <description>&lt;P&gt;Thank you Artem!&lt;/P&gt;&lt;P&gt;I think it is a good
idea to do it this way, if there is no other possibility. We use the avro files
as backup before we update the data on Teradata. If we just need some
information, we can do it with the hive schema on top of the avro files.&lt;/P&gt;&lt;P&gt;Usually we don’t need
to write the data back to Teradata. But a backup without the possibility to
restore the data would be useless.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2017 16:45:03 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Is-it-possible-to-export-avro-files-from-Hadoop-to-Teradata/m-p/163746#M53615</guid>
      <dc:creator>rfluck</dc:creator>
      <dc:date>2017-02-08T16:45:03Z</dc:date>
    </item>
  </channel>
</rss>

