BePPPower opened a new pull request, #14130:
URL: https://github.com/apache/doris/pull/14130
# Proposed changes
Issue Number: close #13959
## Problem summary
S3 table valued function supports `parquet/orc/json` file format.
For example: `parquet format`
```
MySQL [(none)]> select * from s3("URI" =
"http://127.0.0.1:9312/test2/test.snappy.parquet","ACCESS_KEY"= "minioadmin",
"SECRET_KEY" = "minioadmin", "ForMAT" = "parquet") limit 10;
+-----------+------------------------------------------+----------------+----------+-------------------------+--------+-------------+---------------+----------------------+
| p_partkey | p_name | p_mfgr |
p_brand | p_type | p_size | p_container | p_retailprice |
p_comment |
+-----------+------------------------------------------+----------------+----------+-------------------------+--------+-------------+---------------+----------------------+
| 1 | goldenrod lavender spring chocolate lace | Manufacturer#1 |
Brand#13 | PROMO BURNISHED COPPER | 7 | JUMBO PKG | 901 | ly.
slyly ironi |
| 2 | blush thistle blue yellow saddle | Manufacturer#1 |
Brand#13 | LARGE BRUSHED BRASS | 1 | LG CASE | 902 | lar
accounts amo |
| 3 | spring green yellow purple cornsilk | Manufacturer#4 |
Brand#42 | STANDARD POLISHED BRASS | 21 | WRAP CASE | 903 |
egular deposits hag |
| 4 | cornflower chocolate smoke green pink | Manufacturer#3 |
Brand#34 | SMALL PLATED BRASS | 14 | MED DRUM | 904 | p
furiously r |
| 5 | forest brown coral puff cream | Manufacturer#3 |
Brand#32 | STANDARD POLISHED TIN | 15 | SM PKG | 905 |
wake carefully |
| 6 | bisque cornflower lawn forest magenta | Manufacturer#2 |
Brand#24 | PROMO PLATED STEEL | 4 | MED BAG | 906 |
sual a |
| 7 | moccasin green thistle khaki floral | Manufacturer#1 |
Brand#11 | SMALL PLATED COPPER | 45 | SM BAG | 907 |
lyly. ex |
| 8 | misty lace thistle snow royal | Manufacturer#4 |
Brand#44 | PROMO BURNISHED TIN | 41 | LG DRUM | 908 |
eposi |
| 9 | thistle dim navajo dark gainsboro | Manufacturer#4 |
Brand#43 | SMALL BURNISHED STEEL | 12 | WRAP CASE | 909 |
ironic foxe |
| 10 | linen pink saddle puff powder | Manufacturer#5 |
Brand#54 | LARGE BURNISHED STEEL | 44 | LG CAN | 910 |
ithely final deposit |
+-----------+------------------------------------------+----------------+----------+-------------------------+--------+-------------+---------------+----------------------+
```
orc format:
```
MySQL [(none)]> select * from s3("URI" =
"http://127.0.0.1:9312/test2/test.snappy.orc","ACCESS_KEY"= "minioadmin",
"SECRET_KEY" = "minioadmin", "ForMAT" = "orc") limit 10;
+-----------+------------------------------------------+----------------+----------+-------------------------+--------+-------------+---------------+----------------------+
| p_partkey | p_name | p_mfgr |
p_brand | p_type | p_size | p_container | p_retailprice |
p_comment |
+-----------+------------------------------------------+----------------+----------+-------------------------+--------+-------------+---------------+----------------------+
| 1 | goldenrod lavender spring chocolate lace | Manufacturer#1 |
Brand#13 | PROMO BURNISHED COPPER | 7 | JUMBO PKG | 901 | ly.
slyly ironi |
| 2 | blush thistle blue yellow saddle | Manufacturer#1 |
Brand#13 | LARGE BRUSHED BRASS | 1 | LG CASE | 902 | lar
accounts amo |
| 3 | spring green yellow purple cornsilk | Manufacturer#4 |
Brand#42 | STANDARD POLISHED BRASS | 21 | WRAP CASE | 903 |
egular deposits hag |
| 4 | cornflower chocolate smoke green pink | Manufacturer#3 |
Brand#34 | SMALL PLATED BRASS | 14 | MED DRUM | 904 | p
furiously r |
| 5 | forest brown coral puff cream | Manufacturer#3 |
Brand#32 | STANDARD POLISHED TIN | 15 | SM PKG | 905 |
wake carefully |
| 6 | bisque cornflower lawn forest magenta | Manufacturer#2 |
Brand#24 | PROMO PLATED STEEL | 4 | MED BAG | 906 |
sual a |
| 7 | moccasin green thistle khaki floral | Manufacturer#1 |
Brand#11 | SMALL PLATED COPPER | 45 | SM BAG | 907 |
lyly. ex |
| 8 | misty lace thistle snow royal | Manufacturer#4 |
Brand#44 | PROMO BURNISHED TIN | 41 | LG DRUM | 908 |
eposi |
| 9 | thistle dim navajo dark gainsboro | Manufacturer#4 |
Brand#43 | SMALL BURNISHED STEEL | 12 | WRAP CASE | 909 |
ironic foxe |
| 10 | linen pink saddle puff powder | Manufacturer#5 |
Brand#54 | LARGE BURNISHED STEEL | 44 | LG CAN | 910 |
ithely final deposit |
+-----------+------------------------------------------+----------------+----------+-------------------------+--------+-------------+---------------+----------------------+
```
json format:
```
MySQL [(none)]> select * from s3("URI" =
"http://127.0.0.1:9312/test2/data1.json","ACCESS_KEY"= "minioadmin",
"SECRET_KEY" = "minioadmin", "ForMAT" = "json", "strip_outer_array" = "true",
"read_json_by_line" = "false");
+------+------+------+
| id | name | age |
+------+------+------+
| 1 | ftw | 18 |
| 2 | xxx | 17 |
| 3 | yyy | 19 |
+------+------+------+
MySQL [(none)]> select * from s3("URI" =
"http://127.0.0.1:9312/test2/data.json","ACCESS_KEY"= "minioadmin",
"SECRET_KEY" = "minioadmin", "ForMAT" = "json", "strip_outer_array" = "true",
"jsonpaths" = "[\"$.id\", \"$.age\"]");
+------+------+
| id | age |
+------+------+
| 1 | 18 |
| 2 | 17 |
| 3 | 19 |
+------+------+
```
## Checklist(Required)
1. Does it affect the original behavior:
- [x] Yes
- [ ] No
- [ ] I don't know
2. Has unit tests been added:
- [ ] Yes
- [x] No
- [ ] No Need
3. Has document been added or modified:
- [ ] Yes
- [x] No
- [ ] No Need
4. Does it need to update dependencies:
- [ ] Yes
- [x] No
5. Are there any changes that cannot be rolled back:
- [ ] Yes (If Yes, please explain WHY)
- [x] No
## Further comments
If this is a relatively large or complex change, kick off the discussion at
[[email protected]](mailto:[email protected]) by explaining why you
chose the solution you did and what alternatives you considered, etc...
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]