You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/03/15 12:33:13 UTC

[GitHub] [arrow-datafusion] matthewmturner edited a comment on issue #1877: Improved schema and catalog support from SQL

matthewmturner edited a comment on issue #1877:
URL: https://github.com/apache/arrow-datafusion/issues/1877#issuecomment-1067933514


   ah yeah, i was referring to in my PR (#1959) which was leveraging on what looked like an incomplete feature for properly resolving catalog / schema / table.  You can still query for single table names in the currently active catalog / schema - which right now is only 'datafusion' and 'public' - but i plan on adding a feature (such as psql \c to connect to database) to help with that.
   
   I made significant progress on the above referenced PR, just working on the ballista serialization now.  Would be good to get another set of eyes on it if youre interested.  Below is example from that PR.
   
   ```
   ❯ CREATE SCHEMA abc;
   0 rows in set. Query took 0.001 seconds.
   ❯ CREATE TABLE abc.y AS VALUES (1,2,3);
   0 rows in set. Query took 0.002 seconds.
   ❯ SHOW TABLES;
   +---------------+--------------------+----------------+------------+
   | table_catalog | table_schema       | table_name     | table_type |
   +---------------+--------------------+----------------+------------+
   | datafusion    | public             | alltypes_plain | BASE TABLE |
   | datafusion    | public             | x              | BASE TABLE |
   | datafusion    | abc                | y              | BASE TABLE |
   | datafusion    | information_schema | tables         | VIEW       |
   | datafusion    | information_schema | columns        | VIEW       |
   +---------------+--------------------+----------------+------------+
   5 rows in set. Query took 0.016 seconds.
   ❯ SELECT * FROM x;
   +---------+---------+
   | column1 | column2 |
   +---------+---------+
   | 1       | 2       |
   +---------+---------+
   1 row in set. Query took 0.004 seconds.
   ❯ SELECT * FROM y;
   Plan("Table or CTE with name 'y' not found")
   ❯ SELECT * FROM abc.y;
   +---------+---------+---------+
   | column1 | column2 | column3 |
   +---------+---------+---------+
   | 1       | 2       | 3       |
   +---------+---------+---------+
   1 row in set. Query took 0.005 seconds.
   ```


-- 
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@arrow.apache.org

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