Manish Maheshwari created IMPALA-11255:
------------------------------------------

             Summary: Iceberg partitioned insert Error: can't multiply sequence 
by non-int of type 'float'
                 Key: IMPALA-11255
                 URL: https://issues.apache.org/jira/browse/IMPALA-11255
             Project: IMPALA
          Issue Type: Bug
            Reporter: Manish Maheshwari


Table Structures - 
{code:java}
CREATE EXTERNAL TABLE prescribing_p_e.prescriptions_fact_all (
  sha STRING,
  pct STRING,
  practice_code STRING,
  bnf_presentation_code STRING,
  bnf_name STRING,
  items BIGINT,
  nic DOUBLE,
  act_cost DOUBLE,
  quantity BIGINT,
  period BIGINT,
  not_used STRING,
  no_of_records BIGINT
)
STORED AS PARQUET
LOCATION 
's3a://demo-aws-go02/go02-demo/jeffrothwell/prescribing/source_parquet/prescriptions_fact_all_p'
TBLPROPERTIES ('OBJCAPABILITIES'='EXTREAD,EXTWRITE', 'STATS_GENERATED'='TASK', 
'impala.events.catalogServiceId'='306320071c374e8d:9654c2f8a901e9dc', 
'impala.events.catalogVersion'='78', 
'impala.lastComputeStatsTime'='1641378211', 'numFiles'='51', 
'numFilesErasureCoded'='0', 'numRows'='1010750195', 
'spark.sql.create.version'='2.2 or prior', 
'spark.sql.sources.schema.numParts'='1', 
'spark.sql.sources.schema.part.0'='{\"type\":\"struct\",\"fields\":[{\"name\":\"sha\",\"type\":\"string\",\"nullable\":true,\"metadata\":{}},{\"name\":\"pct\",\"type\":\"string\",\"nullable\":true,\"metadata\":{}},{\"name\":\"practice_code\",\"type\":\"string\",\"nullable\":true,\"metadata\":{}},{\"name\":\"bnf_presentation_code\",\"type\":\"string\",\"nullable\":true,\"metadata\":{}},{\"name\":\"bnf_name\",\"type\":\"string\",\"nullable\":true,\"metadata\":{}},{\"name\":\"items\",\"type\":\"long\",\"nullable\":true,\"metadata\":{}},{\"name\":\"nic\",\"type\":\"double\",\"nullable\":true,\"metadata\":{}},{\"name\":\"act_cost\",\"type\":\"double\",\"nullable\":true,\"metadata\":{}},{\"name\":\"quantity\",\"type\":\"long\",\"nullable\":true,\"metadata\":{}},{\"name\":\"period\",\"type\":\"long\",\"nullable\":true,\"metadata\":{}},{\"name\":\"not_used\",\"type\":\"string\",\"nullable\":true,\"metadata\":{}},{\"name\":\"no_of_records\",\"type\":\"long\",\"nullable\":true,\"metadata\":{}}]}',
 'totalSize'='11691280544')


CREATE EXTERNAL TABLE nhs_iceberg.prescriptions_fact_all (
  sha STRING NULL,
  pct STRING NULL,
  practice_code STRING NULL,
  bnf_presentation_code STRING NULL,
  bnf_name STRING NULL,
  items BIGINT NULL,
  nic DOUBLE NULL,
  act_cost DOUBLE NULL,
  quantity BIGINT NULL,
  period BIGINT NULL,
  not_used STRING NULL,
  no_of_records BIGINT NULL
)
PARTITIONED BY SPEC
(
  period
)
STORED AS ICEBERG
LOCATION 
's3a://demo-aws-go02/warehouse/tablespace/external/hive/nhs_iceberg.db/prescriptions_fact_all'
TBLPROPERTIES ('OBJCAPABILITIES'='EXTREAD,EXTWRITE', 
'engine.hive.enabled'='true', 'external.table.purge'='TRUE', 'numFiles'='101', 
'numFilesErasureCoded'='0', 'numRows'='1010750195', 
'previous_metadata_location'='s3a://demo-aws-go02/warehouse/tablespace/external/hive/nhs_iceberg.db/prescriptions_fact_all/metadata/00002-eb138cc6-71af-491a-b3b5-d493e318d04b.metadata.json',
 'table_type'='ICEBERG', 'totalSize'='15568278228', 
'write.format.default'='parquet'){code}


Steps to repro the issue

{code}
create table nhs_iceberg.prescriptions_fact_all stored as iceberg as 
select * from prescribing_p_e.prescriptions_fact_all where 1=2;
ALTER TABLE prescriptions_fact_all SET PARTITION SPEC (period);
insert into prescriptions_fact_all PARTITION(period) 
select * from prescribing_p_e.prescriptions_fact_all ;
{code}

Result with Impala Shell

{code}
[coordinator-default-impala.dw-go02-demo-aws.ylcu-atmi.cloudera.site:443] 
nhs_iceberg> create table nhs_iceberg.prescriptions_fact_all stored as iceberg 
as
select * from prescribing_p_e.prescriptions_fact_all where 1=2;
Query: create table nhs_iceberg.prescriptions_fact_all stored as iceberg as
select * from prescribing_p_e.prescriptions_fact_all where 1=2
Query submitted at: 2022-04-20 23:26:34 (Coordinator: 
http://coordinator-0:25000)
Query progress can be monitored at: 
http://coordinator-0:25000/query_plan?query_id=874a024652fd76f1:6b70371400000000
+-------------------+
| summary           |
+-------------------+
| Inserted 0 row(s) |
+-------------------+
Fetched 1 row(s) in 6.15s

[coordinator-default-impala.dw-go02-demo-aws.ylcu-atmi.cloudera.site:443] 
nhs_iceberg> ALTER TABLE prescriptions_fact_all SET PARTITION SPEC (period);
Query: ALTER TABLE prescriptions_fact_all SET PARTITION SPEC (period)
+-------------------------+
| summary                 |
+-------------------------+
| Updated partition spec. |
+-------------------------+
Fetched 1 row(s) in 6.13s


[coordinator-default-impala.dw-go02-demo-aws.ylcu-atmi.cloudera.site:443] 
nhs_iceberg> insert into prescriptions_fact_all PARTITION(period)
                                                                                
     > select * from prescribing_p_e.prescriptions_fact_all ;
Query: insert into prescriptions_fact_all PARTITION(period)
select * from prescribing_p_e.prescriptions_fact_all
Query submitted at: 2022-04-20 23:26:53 (Coordinator: 
http://coordinator-0:25000)
Query progress can be monitored at: 
http://coordinator-0:25000/query_plan?query_id=23499cf597f2e719:a0cb677900000000
[Not connected] >
Unknown Exception : can't multiply sequence by non-int of type 'float'
Traceback (most recent call last):
[Not connected] >   File 
"/Users/manishmaheshwari/.virtualenvs/impala-shell3/lib/python3.7/site-packages/impala_shell/impala_shell.py",
 line 1249, in _execute_stmt

    self._periodic_wait_callback)
  File 
"/Users/manishmaheshwari/.virtualenvs/impala-shell3/lib/python3.7/site-packages/impala_shell/impala_client.py",
 line 270, in wait_to_finish
    if periodic_callback is not None: periodic_callback()
  File 
"/Users/manishmaheshwari/.virtualenvs/impala-shell3/lib/python3.7/site-packages/impala_shell/impala_shell.py",
 line 1199, in _periodic_wait_callback
    fragment_text = "[%s%s] %s%%
" % ("#" * val, " " * (100 - val), val)
TypeError: can't multiply sequence by non-int of type 'float'
[Not connected] >
[Not connected] >

{code}




--
This message was sent by Atlassian Jira
(v8.20.7#820007)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to