Aster_function load_from_teradata

Aster
Enthusiast

Aster_function load_from_teradata

i happened to this error,"SELECT Failed. 34:  ERROR: The supplied statement could not be completed due to an internal error at a database worker node. Please contact support at Aster Data. ()" my code as follow

CREATE  TABLE ship(

comp_id  varchar(20)

)

DISTRIBUTE BY HASH(comp_id);

insert into ship

SELECT * FROM load_from_teradata

( ON ship

     tdpid('excop1')username('abc')password('abc')

     QUERY('select comp_id from PMART_KPI.MANAGER_QUANTITY')

)

Anyone one can help? Thanks.

Tags (1)
12 REPLIES
Senior Apprentice

Re: Aster_function load_from_teradata

Don'T use your target table in load_from_teradata, use a dummy instead.

 

Teradata Aster Big Analytics Appliance Database User Guide

Teradata-Aster Database Connector

 

Copying Data from Teradata to Aster Database

The load_from_teradata SQL-MR function must be invoked on a partitioned fact table in

Aster Database. This is usually done by using a dummy table, which will be referred to as

“mr_driver”, created as follows:

CREATE TABLE mr_driver(

c1 INT)

DISTRIBUTE BY HASH (c1)

;


insert into ship
SELECT * FROM load_from_teradata
( ON mr_driver
tdpid('excop1')username('abc')password('abc')
QUERY('select comp_id from PMART_KPI.MANAGER_QUANTITY')
)

Dieter

Enthusiast

Re: Aster_function load_from_teradata

STILL GET THIS ERROR

SQLA Version: 14.0.0.1

Driver Version: ODBC 05.0.0000

System.Data.Odbc.OdbcException: ERROR [HY000] [AsterData][nCluster] ERROR: The supplied statement could not be completed due to an internal error at a database worker node.

Please contact support at Aster Data. ()

   at System.Data.Odbc.OdbcConnection.HandleError(OdbcHandle hrHandle, RetCode retcode)

   at System.Data.Odbc.OdbcDataReader.Read()

   at System.Data.Odbc.OdbcDataReader.get_HasRows()

   at Teradata.SQLA.RunQry.DisplayResults(DbDataReader rdr, String stmt, Int32& rowCnt) in F:\ttu140_efix_snap\tdcli\qman\sqla\RunQry.vb:line 465

Enthusiast

Re: Aster_function load_from_teradata

Aster runs on virtual machine with two workers, And the aster database table exactly match teradata table.

Senior Apprentice

Re: Aster_function load_from_teradata

Did you use the mr_driver table? Could you post your full code?

Dieter

Enthusiast

Re: Aster_function load_from_teradata

mr_driver table :    

CREATE TABLE mr_driver(

comp_id  varchar(20))

DISTRIBUTE BY HASH (comp_id)

MR_SQL: 

SELECT

*

FROM load_from_teradata(

ON mr_driver

 tdpid('excop1')username('abc')password('abc')

     QUERY('select comp_id  from PMART_KPI.MANAGER_QUANTITY')

);

And the "comp_id" is varchar(20) in orginal database.

Supporter

Re: Aster_function load_from_teradata

Hi,

the my_driver table is some kind of dummy and should be exactly defined as in the example.

The code below works for me

Ulrich

CREATE TABLE mr_driver( c1 INT)
DISTRIBUTE BY HASH (c1) ;

CREATE TABLE td_calendar DISTRIBUTE BY HASH(day_of_calendar) AS SELECT
* FROM load_from_teradata(
ON mr_driver -- empty Aster mr_driver table
TDPID('myTD') -- Teradata hostname
USERNAME('myUser')
PASSWORD('myPassword')
NUM_INSTANCES('2')
QUERY('SELECT * FROM sys_calendar.calendar')
);
Enthusiast

Re: Aster_function load_from_teradata

unfortunately,it not works for me ! because the aster runs on virtual machine??

Supporter

Re: Aster_function load_from_teradata

Most likely to be a network issue where is can be very ugly to track this down as the issue can be on every layer (VM, host, firewall...). 

Are you sure that your Aster as access to your TD box? 

Can your virtual machine reach the TD via ping? SSH? 

Enthusiast

Re: Aster_function load_from_teradata

it's fixed , its network issue, Thanks, and one more question, how to encode character to UTF-8 when loading from TD to Aster (load_from_teradata).