[ 
https://issues.apache.org/jira/browse/FLINK-29222?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

luoyuxia updated FLINK-29222:
-----------------------------
    Description: 
In hive, `load data inpath` will remove src file, and `load data local inpath` 
won't remove the src file.

But When using the following sql with Hive dialect:
{code:java}
load data local inpath 'test.txt' INTO TABLE tab2 {code}
The file `test.txt` will be removed, although the expected is not to remove the 
`test.txt`.

The reason is the parameter order is not right when try to call 
`HiveCatalog#loadTable(...,  isOverWrite, isSourceLocal)`,

It'll call it with 
{code:java}
hiveCatalog.loadTable(
       ..., 
        hiveLoadDataOperation.isSrcLocal(), // should be isOverwrite
        hiveLoadDataOperation.isOverwrite()); // should be isSrcLocal{code}
 

 

 

  was:
In hive, `load data inpath` will remove src file, and `load data local inpath` 
won't remove the src file.

But When using the following sql with Hive dialect:
{code:java}
load data local inpath 'test.txt' INTO TABLE tab2 {code}
The file `test.txt` will be removed, although the expected is not to remove the 
`test.txt`.

The reason is the parameter order is not right when try to call 
`HiveCatalog#loadTable(...,  isOverWrite, isSourceLocal)`,

It'll call it with 

 
{code:java}
hiveCatalog.loadTable(
       ..., 
        hiveLoadDataOperation.isSrcLocal(), // should be isOverwrite
        hiveLoadDataOperation.isOverwrite()); // should be isSrcLocal{code}
 

 

 


> Wrong behavior for Hive's load data inpath
> ------------------------------------------
>
>                 Key: FLINK-29222
>                 URL: https://issues.apache.org/jira/browse/FLINK-29222
>             Project: Flink
>          Issue Type: Bug
>          Components: Connectors / Hive
>    Affects Versions: 1.16.0
>            Reporter: luoyuxia
>            Priority: Critical
>              Labels: pull-request-available
>             Fix For: 1.16.0
>
>
> In hive, `load data inpath` will remove src file, and `load data local 
> inpath` won't remove the src file.
> But When using the following sql with Hive dialect:
> {code:java}
> load data local inpath 'test.txt' INTO TABLE tab2 {code}
> The file `test.txt` will be removed, although the expected is not to remove 
> the `test.txt`.
> The reason is the parameter order is not right when try to call 
> `HiveCatalog#loadTable(...,  isOverWrite, isSourceLocal)`,
> It'll call it with 
> {code:java}
> hiveCatalog.loadTable(
>        ..., 
>         hiveLoadDataOperation.isSrcLocal(), // should be isOverwrite
>         hiveLoadDataOperation.isOverwrite()); // should be isSrcLocal{code}
>  
>  
>  



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

Reply via email to