Support Questions
Find answers, ask questions, and share your expertise

Unable to import Interval and Period data Teradata using Sqoop-Hortonworks Connector For Teradata

Unable to import Interval and Period data Teradata using Sqoop-Hortonworks Connector For Teradata

Explorer

Hi,

We are using Apache Sqoop to import data from Teradata to Hadoop which connects to Teradata using

hortonworks-teradata-connector which uses the Teradata Connector For Hadoop.

  • We are using hortonworks-teradata-connector-1.4.1
  • Teradata connector for hadoop version is: 1.5.0

The process fails when there is a Interval/Period data type in the source table. Does the Hortonworks Connector for Teradata support Interval/Period data type because I could not find any mention otherwise in the documentation?

https://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.3.2/bk_HortonworksConnectorForTeradata/content/...

I am trying to create a table in Hive corresponding to the table in Teradata using Sqoop command

create-hive-table with --map-column-hive option and mapping the Interval and Period types to "STRING" type in Hive.

But the above is not working I am getting the error log as given below

ERROR LOG:

java.sql.SQLException: [Teradata JDBC Driver] [TeraJDBC 15.10.00.26] [Error 1006] [SQLState HY000] Unrecognized data type: 845 at com.teradata.jdbc.jdbc_4.util.ErrorFactory.makeDriverJDBCException(ErrorFactory.java:95) at com.teradata.jdbc.jdbc_4.util.ErrorFactory.makeDriverJDBCException(ErrorFactory.java:70) at com.teradata.jdbc.jdbc_4.parcel.PrepInfoParcel.createPrepInfoItem(PrepInfoParcel.java:227) at com.teradata.jdbc.jdbc_4.parcel.StatementInfoParcel.translateMetadataItems(StatementInfoParcel.java:169) at com.teradata.jdbc.jdbc_4.parcel.StatementInfoParcel.translateSIPintoPrepInfoItem(StatementInfoParcel.java:154) at com.teradata.jdbc.jdbc_4.parcel.StatementInfoParcel.<init>(StatementInfoParcel.java:123) at com.teradata.jdbc.jdbc_4.parcel.ParcelFactory.nextParcel(ParcelFactory.java:348) at com.teradata.jdbc.jdbc_4.io.TDPacket.nextParcel(TDPacket.java:135) at com.teradata.jdbc.jdbc_4.statemachine.StatementReceiveState.getNextParcel(StatementReceiveState.java:299) at com.teradata.jdbc.jdbc_4.statemachine.ReceiveSuccessSubState.action(ReceiveSuccessSubState.java:72) at com.teradata.jdbc.jdbc_4.statemachine.StatementReceiveState.subStateMachine(StatementReceiveState.java:311) at com.teradata.jdbc.jdbc_4.statemachine.StatementReceiveState.action(StatementReceiveState.java:200) at com.teradata.jdbc.jdbc_4.statemachine.StatementController.runBody(StatementController.java:137) at com.teradata.jdbc.jdbc_4.statemachine.StatementController.run(StatementController.java:128) at com.teradata.jdbc.jdbc_4.TDStatement.executeStatement(TDStatement.java:389) at com.teradata.jdbc.jdbc_4.TDStatement.prepareRequest(TDStatement.java:576) at com.teradata.jdbc.jdbc_4.TDPreparedStatement.<init>(TDPreparedStatement.java:127) at com.teradata.jdbc.jdk6.JDK6_SQL_PreparedStatement.<init>(JDK6_SQL_PreparedStatement.java:30) at com.teradata.jdbc.jdk6.JDK6_SQL_Connection.constructPreparedStatement(JDK6_SQL_Connection.java:81) at com.teradata.jdbc.jdbc_4.TDSession.prepareStatement(TDSession.java:1330) at com.teradata.jdbc.jdbc_4.TDSession.prepareStatement(TDSession.java:1374) at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:744) at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:767) at org.apache.sqoop.manager.SqlManager.getColumnInfoForRawQuery(SqlManager.java:270) at org.apache.sqoop.manager.SqlManager.getColumnTypesForRawQuery(SqlManager.java:241) at org.apache.sqoop.manager.SqlManager.getColumnTypes(SqlManager.java:227) at org.apache.sqoop.hive.TableDefWriter.getCreateTableStmt(TableDefWriter.java:126) at org.apache.sqoop.hive.HiveImport.importTable(HiveImport.java:188) at org.apache.sqoop.tool.CreateHiveTableTool.run(CreateHiveTableTool.java:58) at org.apache.sqoop.Sqoop.run(Sqoop.java:148) at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:76) at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:184) at org.apache.sqoop.Sqoop.runTool(Sqoop.java:226) at org.apache.sqoop.Sqoop.runTool(Sqoop.java:235) at org.apache.sqoop.Sqoop.main(Sqoop.java:244) 16/11/14 10:57:14 ERROR sqoop.Sqoop: Got exception running Sqoop: java.lang.NullPointerException java.lang.NullPointerException at org.apache.sqoop.hive.TableDefWriter.getCreateTableStmt(TableDefWriter.java:175) at org.apache.sqoop.hive.HiveImport.importTable(HiveImport.java:188) at org.apache.sqoop.tool.CreateHiveTableTool.run(CreateHiveTableTool.java:58) at org.apache.sqoop.Sqoop.run(Sqoop.java:148) at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:76) at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:184) at org.apache.sqoop.Sqoop.runTool(Sqoop.java:226) at org.apache.sqoop.Sqoop.runTool(Sqoop.java:235) at org.apache.sqoop.Sqoop.main(Sqoop.java:244

Can anyone throw some light into the above problem? Let me know if you need any further information.

Regards,

Indranil Roy

2 REPLIES 2
Highlighted

Re: Unable to import Interval and Period data Teradata using Sqoop-Hortonworks Connector For Teradata

It seems that your teradata connector/ JDBC driver doesn't support certain data type.

Please check that the dependencies are up-to-date and as per documentation:-

  1. Teradata GSS Client Driver 15.00 or later versions (tdgssconfig)
  2. Teradata JDBC Driver 15.00 or later versions (terajdbc)
  3. Teradata Connector for Hadoop 1.4.1
Highlighted

Re: Unable to import Interval and Period data Teradata using Sqoop-Hortonworks Connector For Teradata

Explorer

But as per the documentation Teradata interval/period data types are supported. Also we are using Teradata Connector For Hadoop 15.0 which is a higher version compared to the version listed in the dependency. So ideally the Interval/Period data types should be supported?