Skip to content

Commit

Permalink
add debug statements
Browse files Browse the repository at this point in the history
  • Loading branch information
mertak-synnada committed Aug 23, 2024
1 parent cc3c4c7 commit 10a7b90
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/parser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5549,6 +5549,7 @@ impl<'a> Parser<'a> {
global: Option<bool>,
transient: bool,
) -> Result<Statement, ParserError> {
println!("Debug 0");
let allow_unquoted_hyphen = dialect_of!(self is BigQueryDialect);
let if_not_exists = self.parse_keywords(&[Keyword::IF, Keyword::NOT, Keyword::EXISTS]);
let table_name = self.parse_object_name(allow_unquoted_hyphen)?;
Expand All @@ -5561,6 +5562,7 @@ impl<'a> Parser<'a> {
} else {
None
};
println!("Debug 5");

let clone = if self.parse_keyword(Keyword::CLONE) {
self.parse_object_name(allow_unquoted_hyphen).ok()
Expand All @@ -5571,16 +5573,19 @@ impl<'a> Parser<'a> {
// parse optional column list (schema)
let (columns, constraints) = self.parse_columns()?;

println!("Debug 7");
// SQLite supports `WITHOUT ROWID` at the end of `CREATE TABLE`
let without_rowid = self.parse_keywords(&[Keyword::WITHOUT, Keyword::ROWID]);

let hive_distribution = self.parse_hive_distribution()?;
let hive_formats = self.parse_hive_formats()?;
// PostgreSQL supports `WITH ( options )`, before `AS`
let mut with_options: Vec<SqlOption> = vec![];
println!("Debug 10");
if !self.parse_keywords(&[Keyword::WITH, Keyword::ORDER]) {
with_options = self.parse_options(Keyword::WITH)?;
}
println!("Debug 11");
let table_properties = self.parse_options(Keyword::TBLPROPERTIES)?;

let engine = if self.parse_keyword(Keyword::ENGINE) {
Expand Down Expand Up @@ -5613,6 +5618,7 @@ impl<'a> Parser<'a> {
None
};

println!("Debug 20");
// ClickHouse supports `PRIMARY KEY`, before `ORDER BY`
// https://clickhouse.com/docs/en/sql-reference/statements/create/table#primary-key
let primary_key = if dialect_of!(self is ClickHouseDialect | GenericDialect)
Expand Down Expand Up @@ -5648,6 +5654,7 @@ impl<'a> Parser<'a> {
order_exprs_option = Some(order_exprs);
}

println!("Debug 30");
let order_by = if self.parse_keywords(&[Keyword::ORDER, Keyword::BY]) {
if self.consume_token(&Token::LParen) {
let columns = if self.peek_token() != Token::RParen {
Expand Down Expand Up @@ -5724,6 +5731,7 @@ impl<'a> Parser<'a> {
} else {
None
};
println!("Debug 50");

Ok(CreateTableBuilder::new(table_name)
.temporary(temporary)
Expand Down

0 comments on commit 10a7b90

Please sign in to comment.