Reading a json external table into spark job issue

Five Stars

Reading a json external table into spark job issue

Hello,

 

I have a Spark Job with a Hive query  that reads an  external table (JSON format), but when i tried to get the colonne INPUT__FILE__NAME i have this error :

hive org.apache.spark.sql.AnalysisException: cannot resolve '`INPUT__FILE__NAME`'

 

My job

tHiveInput -> tMap -> tHiveOutput

 

How can i get the file name ?

 

My config:

Talend Big Data Batch Platform 6.5.1

Cloudera 5.12

 

 

Thanks

smer

 


Accepted Solutions
Five Stars

Re: Reading a json external table into spark job issue

The solution is that "input__file_name" is a virtual hive collumn, i just use the spark's function  input_file_name() and that's it Smiley Happy

 


All Replies
Six Stars

Re: Reading a json external table into spark job issue

use the row name row1.filename

Five Stars

Re: Reading a json external table into spark job issue

Hello jcruie,

This solution in not working, because the row1.filename is unkown.
my job is
tHiveInput->(row1)->tmap->(row2)->thiveOutput
i use the row1.filename in ten tmap, and in the query hive but not working.

Regards
smer


Six Stars

Re: Reading a json external table into spark job issue

If filename is in tmap you need to use row2.filename

Five Stars

Re: Reading a json external table into spark job issue

The solution is that "input__file_name" is a virtual hive collumn, i just use the spark's function  input_file_name() and that's it Smiley Happy

 

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Put Massive Amounts of Data to Work

Learn how to make your data more available, reduce costs and cut your build time

Watch Now

How OTTO Utilizes Big Data to Deliver Personalized Experiences

Read about OTTO's experiences with Big Data and Personalized Experiences

Blog

Talend Integration with Databricks

Take a look at this video about Talend Integration with Databricks

Watch Now