You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "tv42 (via GitHub)" <gi...@apache.org> on 2024/11/11 20:50:10 UTC

[I] Make `CreateTable.location` / `AlterTable.location` make more sense [datafusion-sqlparser-rs]

tv42 opened a new issue, #1518:
URL: https://github.com/apache/datafusion-sqlparser-rs/issues/1518

   `CreateTable.location` has no documentation and is a tricky edge case, not always set even when SQL statement did set location.
   
   https://docs.rs/sqlparser/latest/sqlparser/ast/struct.CreateTable.html#structfield.location
   
   Since this took some time to figure out, here's what I've found for others also pondering its role:
   
   - `CREATE EXTERNAL TABLE .. LOCATION 'foo'` sets `CreateTable.location`
   - `CREATE TABLE .. LOCATION 'foo'` sets `CreateTable.hive_formats.location`
   - `ALTER TABLE .. LOCATION` sets `AlterTable.location`
   - `AlterTable.location` types are about Hive, and is thus a bit confusing for external tables: https://docs.rs/sqlparser/latest/sqlparser/ast/enum.Statement.html#variant.AlterTable.field.location
   - alter vs create behaviors thus do not match
   
   Maybe make Hive syntax use the top-level `location` field?


-- 
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: github-unsubscribe@datafusion.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] Make `CreateTable.location` / `AlterTable.location` make more sense [datafusion-sqlparser-rs]

Posted by "tv42 (via GitHub)" <gi...@apache.org>.
tv42 commented on issue #1518:
URL: https://github.com/apache/datafusion-sqlparser-rs/issues/1518#issuecomment-2468999986

   Somewhat similar issue about `CREATE DATABASE .. LOCATION`: https://github.com/apache/datafusion-sqlparser-rs/issues/453


-- 
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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org