kyuubi/dev
Cheng Pan a3d9ca31d3
[KYUUBI #1974] Support merge small files in multi insert statement
### _Why are the changes needed?_

This PR aims to support auto merge small files in multi insert statement, for example

`FROM VALUES(1) INSERT INTO tmp1 SELECT * INSERT INTO tmp2 SELECT *;`

will generate the following plan, `Union` is the root node instead of `InsertIntoHiveTable`

```
Union
:- InsertIntoHiveTable
:  +- Project
:    +- LocalRelation
+- InsertIntoHiveTable
   +- Project
     +- LocalRelation
```

This PR also fixed the `canInsertRepartitionByExpression`, previous it did not consider the `SubqueryAlias` which may cause inserting error `Repartition`/`Reblance` node and currupt the data distribution, e.g.

`FROM (SELECT * FROM VALUES(1) DOSTRIBUTE BY col1) INSERT INTO tmp1 SELECT * INSERT INTO tmp2 SELECT *;`

```
Union
:- InsertIntoHiveTable
:  +- Project
:     +- SubqueryAlias
:        +- RepartitionByExpression
:           +- Project
:              +- LocalRelation
+- InsertIntoHiveTable
   +- Project
      +- SubqueryAlias
         +- RepartitionByExpression
            +- Project
               +- LocalRelation
```

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [x] [Run test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #1974 from pan3793/ext.

Closes #1974

56cd7734 [Cheng Pan] nit
e0155c27 [Cheng Pan] Support merge small files in multi table insertion

Authored-by: Cheng Pan <chengpan@apache.org>
Signed-off-by: Cheng Pan <chengpan@apache.org>
2022-02-24 21:10:46 +08:00
..
kyuubi-codecov [KYUUBI #1949] [INFA] Add homepage for every module in maven central 2022-02-21 21:09:29 +08:00
kyuubi-extension-spark-3-1 [KYUUBI #1974] Support merge small files in multi insert statement 2022-02-24 21:10:46 +08:00
kyuubi-extension-spark-3-2 [KYUUBI #1974] Support merge small files in multi insert statement 2022-02-24 21:10:46 +08:00
kyuubi-extension-spark-common [KYUUBI #1974] Support merge small files in multi insert statement 2022-02-24 21:10:46 +08:00
kyuubi-tpcds [KYUUBI #1949] [INFA] Add homepage for every module in maven central 2022-02-21 21:09:29 +08:00
checkout_pr.sh [KYUUBI #1233] Add checkout_pr.sh script 2021-10-14 13:53:09 +08:00
dependencyList [KYUUBI #1948] Upgrade thrift version to 0.16.0 2022-02-23 20:51:59 +08:00
merge_kyuubi_pr.py [KYUUBI #1957] Skip html comments in merge commit test body from PR desc 2022-02-22 14:19:49 +08:00
reformat [KYUUBI #1496] Support tpcds benchmark 2021-12-06 20:08:08 +08:00