You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datafusion.apache.org by gi...@apache.org on 2025/12/03 05:14:55 UTC
(datafusion-sqlparser-rs) branch gh-readonly-queue/main/pr-2108-0dbb9c9f9a3876303d6d8cf8d246867441fe4b57 created (now 5a3b63bf)
This is an automated email from the ASF dual-hosted git repository.
github-bot pushed a change to branch gh-readonly-queue/main/pr-2108-0dbb9c9f9a3876303d6d8cf8d246867441fe4b57
in repository https://gitbox.apache.org/repos/asf/datafusion-sqlparser-rs.git
at 5a3b63bf Fixing location for extrenal tables (#2108)
This branch includes the following new commits:
new 5a3b63bf Fixing location for extrenal tables (#2108)
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datafusion.apache.org
For additional commands, e-mail: commits-help@datafusion.apache.org
(datafusion-sqlparser-rs) 01/01: Fixing location for extrenal tables (#2108)
Posted by gi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
github-bot pushed a commit to branch gh-readonly-queue/main/pr-2108-0dbb9c9f9a3876303d6d8cf8d246867441fe4b57
in repository https://gitbox.apache.org/repos/asf/datafusion-sqlparser-rs.git
commit 5a3b63bf419ff80e6acdb0b3bbdbcf664083f1d5
Author: Andriy Romanov <ar...@montecarlodata.com>
AuthorDate: Tue Dec 2 21:14:34 2025 -0800
Fixing location for extrenal tables (#2108)
---
src/ast/ddl.rs | 4 +++-
tests/sqlparser_hive.rs | 2 ++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/ast/ddl.rs b/src/ast/ddl.rs
index 0df53c14..ad3191eb 100644
--- a/src/ast/ddl.rs
+++ b/src/ast/ddl.rs
@@ -2803,7 +2803,9 @@ impl fmt::Display for CreateTable {
if let Some(file_format) = self.file_format {
write!(f, " STORED AS {file_format}")?;
}
- write!(f, " LOCATION '{}'", self.location.as_ref().unwrap())?;
+ if let Some(location) = &self.location {
+ write!(f, " LOCATION '{location}'")?;
+ }
}
match &self.table_options {
diff --git a/tests/sqlparser_hive.rs b/tests/sqlparser_hive.rs
index 386bab7f..1b094851 100644
--- a/tests/sqlparser_hive.rs
+++ b/tests/sqlparser_hive.rs
@@ -34,10 +34,12 @@ fn parse_table_create() {
let sql = r#"CREATE TABLE IF NOT EXISTS db.table (a BIGINT, b STRING, c TIMESTAMP) PARTITIONED BY (d STRING, e TIMESTAMP) STORED AS ORC LOCATION 's3://...' TBLPROPERTIES ("prop" = "2", "asdf" = '1234', 'asdf' = "1234", "asdf" = 2)"#;
let iof = r#"CREATE TABLE IF NOT EXISTS db.table (a BIGINT, b STRING, c TIMESTAMP) PARTITIONED BY (d STRING, e TIMESTAMP) STORED AS INPUTFORMAT 'org.apache.hadoop.hive.ql.io.orc.OrcInputFormat' OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat' LOCATION 's3://...'"#;
let serdeproperties = r#"CREATE EXTERNAL TABLE IF NOT EXISTS db.table (a STRING, b STRING, c STRING) PARTITIONED BY (d STRING, e STRING) ROW FORMAT SERDE 'org.apache.hadoop.hive.serde.config' WITH SERDEPROPERTIES ('prop_a' = 'a', 'prop_b' = 'b') STORED AS TEXTFILE LOCATION 's3://...' TBLPROPERTIES ('prop_c' = 'c')"#;
+ let externaltable = r#"CREATE EXTERNAL TABLE t (c INT)"#;
hive().verified_stmt(sql);
hive().verified_stmt(iof);
hive().verified_stmt(serdeproperties);
+ hive().verified_stmt(externaltable);
}
#[test]
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datafusion.apache.org
For additional commands, e-mail: commits-help@datafusion.apache.org