I'm on the prebaked VM i downloaded from Cloudera, and I have a strange
error trying an Insert Overwrite Query via Impala.
I have two tables, as you can see below, the tables are indentical with the
only difference the source table is partitioned by a string, and the target
table is not partitioned, the string is just a 'normal' column.
When i try to insert overwrite in the target table with selecting from the
source table i get an error, that tells me inserting in the table would
cause a loss of precision because it would need an implicit cast from
'<SLOT 15>' (whatever that means?) to 'INT'.
The tried the select part as a query itself, and it works fine, as the
error is from inserting.
How can that be, since the tables are nearly identical, and the values are
of compatible types (the same to be precise)?!
Thanks for your help in advance!
Here are the Tables, the Query and the Error Message:
I changed the column names, but its copy&paste from the statements i use.
Table 1 looks like this:
CREATE TABLE source (
) PARTITIONED BY (time string) ROW FORMAT DELIMITED FIELDS TERMINATED BY
',' STORED AS TEXTFILE;
CREATE TABLE target (
) ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' STORED AS TEXTFILE;
i use it to aggregate the data to an hour level that is more precise in the
source column, the concat and substr functions are the get time in the
string that have minutes and second both 00 since the min(time) must not
INSERT OVERWRITE TABLE target SELECT
CONCAT(SUBSTR(MIN(time),1,13),':00:00'), col1, col2, col3, col4,
SUM(summe), col6 FROM source GROUP BY day(time), hour(time), col4, col1,
col2, col3, col6;
ERROR: com.cloudera.impala.common.AnalysisException: Analysis exception (in
**here stands my query**)
Caused by: com.cloudera.impala.common.AnalysisException: Inserting into
target table '**my target table**' may result in loss of precision.
Would need to cast '<slot 15>' to 'INT'.
... 2 more