Skip to content

Conversation

@HaoYang670
Copy link
Contributor

@HaoYang670 HaoYang670 commented Nov 18, 2022

Signed-off-by: remzi 13716567376yh@gmail.com

Which issue does this PR close?

Part of #4262.

Rationale for this change

What changes are included in this PR?

Fix the errors in parsing with header row and partitioned by.

Are these changes tested?

Are there any user-facing changes?

Signed-off-by: remzi <13716567376yh@gmail.com>
@HaoYang670 HaoYang670 marked this pull request as draft November 18, 2022 05:30
@github-actions github-actions bot added the sql SQL Planner label Nov 18, 2022
@HaoYang670
Copy link
Contributor Author

HaoYang670 commented Nov 18, 2022

For COMPRESSION TYPE, things go a little different, as COMPRESSION isn't a Keyword in sqlparser. We can either wait for the sqlparser to update, or fix in datafusion with a different way:

   fn parse_has_file_compression_type(&mut self) -> Result<bool, ParserError> {
        // return error if finding `compression` but not find `TYPE`
    }

let sql = "CREATE EXTERNAL TABLE t STORED AS CSV WITH HEADER LOCATION 'abc'";
expect_parse_error(sql, "sql parser error: Expected LOCATION, found: WITH");

// Error case: `with header` is an invalid syntax
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: comment seems incorrect here

@HaoYang670 HaoYang670 changed the title Return parse error for invalid sql syntax Fix bugs in parsing with header row and partitioned by Nov 19, 2022
@HaoYang670 HaoYang670 marked this pull request as ready for review November 19, 2022 12:18
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @HaoYang670

@alamb
Copy link
Contributor

alamb commented Nov 20, 2022

CI failure due to #4294 (not this PR)

@alamb alamb merged commit 0bb5d4d into apache:master Nov 20, 2022
@ursabot
Copy link

ursabot commented Nov 20, 2022

Benchmark runs are scheduled for baseline = 60d9bbe and contender = 0bb5d4d. 0bb5d4d is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on ec2-t3-xlarge-us-east-2] ec2-t3-xlarge-us-east-2
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on test-mac-arm] test-mac-arm
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on ursa-i9-9960x] ursa-i9-9960x
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on ursa-thinkcentre-m75q] ursa-thinkcentre-m75q
Buildkite builds:
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

@HaoYang670 HaoYang670 deleted the 4262_with_header_row branch November 21, 2022 03:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sql SQL Planner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants