daicheng created IMPALA-12437:
---------------------------------

             Summary: CTAS show success but no data inserted
                 Key: IMPALA-12437
                 URL: https://issues.apache.org/jira/browse/IMPALA-12437
             Project: IMPALA
          Issue Type: Bug
    Affects Versions: Impala 4.1.1
         Environment: impala 4.1.1
hive 3.1.1
            Reporter: daicheng
         Attachments: image-2023-09-09-15-26-12-901.png

h1. CTAS show insert success but no row data inserted.

h2. step one ,check the source table, the table have some row data:
{code:sql}
---QUERY
select * from t_time_parquet;
---RESULTS
+----+---------------------+
| id | ts                  |
+----+---------------------+
| 7  | 2023-08-28 01:23:00 |
| 5  | 2023-08-23 00:23:00 |
| 3  | 2023-08-22 19:00:10 |
| 4  | 2023-08-22 19:00:10 |
| 1  | 2023-08-22 17:00:10 |
| 2  | 2023-08-23 08:23:00 |
| 6  | 2023-08-23 01:23:00 |
+----+---------------------+
Fetched 7 row(s) in 0.11s

{code}
h2. step two, insert data to another parquet table:

{code:sql}
---QUERY
create table t_time_parquet_inner4 as select * from t_time_parquet;
---RESULTS
+-------------------+
| summary           |
+-------------------+
| Inserted 7 row(s) |
+-------------------+
Fetched 1 row(s) in 0.35s
{code}
it shows 7 rows inserted, and the impala server log show query sucessfully.

{code:sql}
I0909 14:58:18.430886  8383 coordinator.cc:151] 
32455cedaa0b6a4b:431b7dcd00000000] Exec() 
query_id=32455cedaa0b6a4b:431b7dcd00000000 stmt=create table 
t_time_parquet_inner5 stored as parquet as select * from t_time_parquet
I0909 14:58:18.430989  8383 coordinator.cc:476] 
32455cedaa0b6a4b:431b7dcd00000000] starting execution on 1 backends for 
query_id=32455cedaa0b6a4b:431b7dcd00000000
I0909 14:58:18.431275 68652 control-service.cc:148] 
32455cedaa0b6a4b:431b7dcd00000000] ExecQueryFInstances(): 
query_id=32455cedaa0b6a4b:431b7dcd00000000 coord=bigdata.dev.slave6.com:27000 
#instances=1
I0909 14:58:18.431730  8383 coordinator.cc:535] 
32455cedaa0b6a4b:431b7dcd00000000] started execution on 1 backends for 
query_id=32455cedaa0b6a4b:431b7dcd00000000
I0909 14:58:18.431825  8392 query-state.cc:942] 
32455cedaa0b6a4b:431b7dcd00000000] Executing instance. 
instance_id=32455cedaa0b6a4b:431b7dcd00000000 fragment_idx=0 
per_fragment_instance_idx=0 coord_state_idx=0 #in-flight=1
I0909 14:58:18.432495  8384 coordinator.cc:907] Coordinator waiting for 
backends to finish, 1 remaining. query_id=32455cedaa0b6a4b:431b7dcd00000000
I0909 14:58:18.491533  8392 query-state.cc:951] 
32455cedaa0b6a4b:431b7dcd00000000] Instance completed. 
instance_id=32455cedaa0b6a4b:431b7dcd00000000 #in-flight=0 status=OK
I0909 14:58:18.491546  8391 query-state.cc:462] 
32455cedaa0b6a4b:431b7dcd00000000] UpdateBackendExecState(): last report for 
32455cedaa0b6a4b:431b7dcd00000000
I0909 14:58:18.492408 68652 coordinator.cc:1056] Backend completed: 
host=bigdata.dev.slave6.com:27000 remaining=1 
query_id=32455cedaa0b6a4b:431b7dcd00000000
I0909 14:58:18.492486  8384 coordinator.cc:855] Finalizing query: 
32455cedaa0b6a4b:431b7dcd00000000
I0909 14:58:18.542811  8384 coordinator.cc:899] Removing staging directory: 
hdfs://bigdata.dev.slave1.com:8020/warehouse/tablespace/external/hive/test_impala.db/t_time_parquet_inner5/_impala_insert_staging/32455cedaa0b6a4b_431b7dcd00000000/
I0909 14:58:18.544164  8384 coordinator.cc:735] ExecState: query 
id=32455cedaa0b6a4b:431b7dcd00000000 execution completed
I0909 14:58:18.544195  8384 coordinator.cc:1399] Release admission control 
resources for query_id=32455cedaa0b6a4b:431b7dcd00000000
I0909 14:58:18.544322  8384 client-request-state.cc:1417] Updating metastore 
with 1 altered partitions ()
I0909 14:58:18.544329  8384 client-request-state.cc:1446] Executing 
FinalizeDml() using CatalogService
I0909 14:58:18.642915  8384 ImpaladCatalog.java:223] Adding: 
TABLE:test_impala.t_time_parquet_inner5 version: 344 size: 1687
I0909 14:58:18.643332  8384 client-request-state.cc:1562] Inserted 7 row(s)
I0909 14:58:18.674379 98382 impala-hs2-server.cc:843] CloseOperation(): 
query_id=32455cedaa0b6a4b:431b7dcd00000000
I0909 14:58:18.674391 98382 impala-server.cc:1436] UnregisterQuery(): 
query_id=32455cedaa0b6a4b:431b7dcd00000000
I0909 14:58:18.674400 98382 coordinator-backend-state.cc:998] 
query_id=32455cedaa0b6a4b:431b7dcd00000000 target backend=192.168.104.94:27000: 
Not cancelling because the backend is already done:
I0909 14:58:18.674407 98382 coordinator.cc:1023] CancelBackends() 
query_id=32455cedaa0b6a4b:431b7dcd00000000, tried to cancel 0 backends
I0909 14:58:18.675757 69073 impala-server.cc:1468] Query successfully 
unregistered: query_id=32455cedaa0b6a4b:431b7dcd00000000

{code}
  
h2. step three, check the result data of target table ,found no data

{code:sql}
---QUERY
select * from  t_time_parquet_inner4;
---RESULT
#EXPECT got 7 rows data, but got 0 rows
---RESULTS
Query: select * from  t_time_parquet_inner4
Query submitted at: 2023-09-09 15:21:52 (Coordinator: 
http://bigdata.dev.slave6.com:25000)
Query progress can be monitored at: 
http://bigdata.dev.slave6.com:25000/query_plan?query_id=374756c9e2638d0c:50997aa200000000
Fetched 0 row(s) in 0.11s
{code}

check the location of parquet file, found the dir is empty

{code:sql}
Query: show create table t_time_parquet_inner4
+----------------------------------------------------------------------------------------------------------------------+
| result                                                                        
                                       |
+----------------------------------------------------------------------------------------------------------------------+
| CREATE TABLE test_impala.t_time_parquet_inner4 (                              
                                       |
|   id INT,                                                                     
                                       |
|   ts TIMESTAMP                                                                
                                       |
| )                                                                             
                                       |
| STORED AS TEXTFILE                                                            
                                       |
| LOCATION 
'hdfs://bigdata.dev.slave1.com:8020/warehouse/tablespace/managed/hive/test_impala.db/t_time_parquet_inner4'
 |
| TBLPROPERTIES ('OBJCAPABILITIES'='EXTREAD,EXTWRITE', 'accessType'='8')        
                                       |
+----------------------------------------------------------------------------------------------------------------------+
Fetched 1 row(s) in 0.00s

{code}

the location of table is empty:
 !image-2023-09-09-15-26-12-901.png! 




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to