Skip to main content
Tome
Silver ⭐️⭐️
January 11, 2019
Solved

updating table

hello all,

 

Trying to update a  table where date_num is  a  date(timestamp) and "day" is the field i want to update but i am getting errors

Anyhting wrong with the query below?

 

update anp_catdidai1_working.dim_bsp_date

set day=day(date_num)

EricL
EricLAnswer
Platinum ⭐️⭐️
January 21, 2019
UPDATE statement in Impala?

Are you using KUDU as the underlining table? If not, then UPDATE is not supported. Please refer to below link:

https://www.cloudera.com/documentation/enterprise/latest/topics/impala_update.html

"This statement only works for Impala tables that use the Kudu storage engine."

4 replies

EricL
Platinum ⭐️⭐️
Platinum ⭐️⭐️
January 16, 2019
What's the error you are getting?

Have you tried to add ` around the day, since it is reserved as a UDF function? Like below:

update anp_catdidai1_working.dim_bsp_date set `day`=day(date_num);

Translate
Tome
TomeAuthor
Silver ⭐️⭐️
January 20, 2019

Hi EricL,

 

This is the error i get:

 

SQL Error [500051] [HY000]: [Simba][ImpalaJDBCDriver](500051) ERROR processing query/statement. Error Code: 0, SQL state: TStatus(statusCode:ERROR_STATUS, sqlState:HY000, errorMessage:AnalysisException: Syntax error in line 1:
update  anp_catdidai1_working.dim_bsp_date
^
Encountered: IDENTIFIER
Expected: ALTER, COMPUTE, CREATE, DESCRIBE, DROP, EXPLAIN, GRANT, INSERT, INVALIDATE, LOAD, REFRESH, REVOKE, SELECT, SET, SHOW, TRUNCATE, USE, VALUES, WITH

CAUSED BY: Exception: Syntax error
), Query: update  anp_catdidai1_working.dim_bsp_date
set day=day(date_num).
  [Simba][ImpalaJDBCDriver](500051) ERROR processing query/statement. Error Code: 0, SQL state: TStatus(statusCode:ERROR_STATUS, sqlState:HY000, errorMessage:AnalysisException: Syntax error in line 1:
update  anp_catdidai1_working.dim_bsp_date
^
Encountered: IDENTIFIER
Expected: ALTER, COMPUTE, CREATE, DESCRIBE, DROP, EXPLAIN, GRANT, INSERT, INVALIDATE, LOAD, REFRESH, REVOKE, SELECT, SET, SHOW, TRUNCATE, USE, VALUES, WITH

CAUSED BY: Exception: Syntax error
), Query: update  anp_catdidai1_working.dim_bsp_date
set day=day(date_num).
    com.cloudera.support.exceptions.GeneralException: [Simba][ImpalaJDBCDriver](500051) ERROR processing query/statement. Error Code: 0, SQL state: TStatus(statusCode:ERROR_STATUS, sqlState:HY000, errorMessage:AnalysisException: Syntax error in line 1:
update  anp_catdidai1_working.dim_bsp_date
^
Encountered: IDENTIFIER
Expected: ALTER, COMPUTE, CREATE, DESCRIBE, DROP, EXPLAIN, GRANT, INSERT, INVALIDATE, LOAD, REFRESH, REVOKE, SELECT, SET, SHOW, TRUNCATE, USE, VALUES, WITH

CAUSED BY: Exception: Syntax error
), Query: update  anp_catdidai1_working.dim_bsp_date
set day=day(date_num).

 

I also  tried with 'day' and  same error

Translate
EricL
Platinum ⭐️⭐️
EricLAnswer
Platinum ⭐️⭐️
January 21, 2019
UPDATE statement in Impala?

Are you using KUDU as the underlining table? If not, then UPDATE is not supported. Please refer to below link:

https://www.cloudera.com/documentation/enterprise/latest/topics/impala_update.html

"This statement only works for Impala tables that use the Kudu storage engine."
Translate