findepi commented on code in PR #13706: URL: https://github.com/apache/datafusion/pull/13706#discussion_r1934410805
########## docs/source/user-guide/sql/dialect.md: ########## @@ -0,0 +1,53 @@ +<!--- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> + +# SQL Dialect + +The included SQL supported in Apache DataFusion mostly follows the [PostgreSQL +SQL dialect], including: + +- The SQL parser and [SQL planner] +- Type checking, analyzer, and type coercions +- Semantics of functions bundled with DataFusion + +Notable exceptions: + +- Array/List functions and semantics follow the [DuckDB SQL dialect]. +- DataFusion's type system is based on the [Apache Arrow type system], and the mapping to PostgreSQL types is not always 1:1. +- DataFusion has its own syntax (dialect) for certain operations (like [`CREATE EXTERNAL TABLE`]) + +As Apache DataFusion is designed to be fully customizable, systems built on +DataFusion can and do implement different SQL semantics. Using DataFusion's APIs, +you can provide alternate function definitions, type rules, and/or SQL syntax +that matches other systems such as Apache Spark or MySQL or your own custom +semantics. Review Comment: We could make it explicit that other systems may not only use configuration options on session context, but also plug at different levels. For example ~SDF~ dbt compiler produces logical plans on its own, and Comet assemblies physical plans before giving control to the DF core. For those use-cases this document, talking about SQL dialect, is irrelevant, except for the function semantics aspects. ########## docs/source/user-guide/sql/dialect.md: ########## @@ -0,0 +1,53 @@ +<!--- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> + +# SQL Dialect + +The included SQL supported in Apache DataFusion mostly follows the [PostgreSQL +SQL dialect], including: + +- The sql parser and [SQL planner] +- Type checking, analyzer, and type coercions +- Semantics of functions bundled with DataFusion + +Notable exceptions: + +- Array/List functions and semantics follow the [DuckDB SQL dialect]. Review Comment: "Array functions and semantics follow the DuckDB dialect for (as they call it) list functions" could convey this -- 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-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org