bec80d7eec
### What changes were proposed in this pull request? This PR introduces a new property `spark.sql.cli.print.header` to let users change the behavior of printing header for spark-sql CLI by SET command. ### Why are the changes needed? Like Hive CLI, spark-sql CLI accepts `hive.cli.print.header` property and we can change the behavior of printing header. But spark-sql CLI doesn't allow users to change Hive specific configurations dynamically by SET command. So, it's better to support the way to change the behavior by SET command. ### Does this PR introduce _any_ user-facing change? Yes. Users can dynamically change the behavior by SET command. ### How was this patch tested? I confirmed with the following commands/queries. ``` spark-sql> select (1) as a, (2) as b, (3) as c, (4) as d; 1 2 3 4 Time taken: 3.218 seconds, Fetched 1 row(s) spark-sql> set spark.sql.cli.print.header=true; key value spark.sql.cli.print.header true Time taken: 1.506 seconds, Fetched 1 row(s) spark-sql> select (1) as a, (2) as b, (3) as c, (4) as d; a b c d 1 2 3 4 Time taken: 0.79 seconds, Fetched 1 row(s) ``` Closes #31173 from sarutak/spark-sql-print-header. Authored-by: Kousuke Saruta <sarutak@oss.nttdata.com> Signed-off-by: HyukjinKwon <gurwls223@apache.org> |
||
---|---|---|
.. | ||
catalyst | ||
core | ||
hive | ||
hive-thriftserver | ||
create-docs.sh | ||
gen-sql-api-docs.py | ||
gen-sql-config-docs.py | ||
gen-sql-functions-docs.py | ||
mkdocs.yml | ||
README.md |
Spark SQL
This module provides support for executing relational queries expressed in either SQL or the DataFrame/Dataset API.
Spark SQL is broken up into four subprojects:
- Catalyst (sql/catalyst) - An implementation-agnostic framework for manipulating trees of relational operators and expressions.
- Execution (sql/core) - A query planner / execution engine for translating Catalyst's logical query plans into Spark RDDs. This component also includes a new public interface, SQLContext, that allows users to execute SQL or LINQ statements against existing RDDs and Parquet files.
- Hive Support (sql/hive) - Includes extensions that allow users to write queries using a subset of HiveQL and access data from a Hive Metastore using Hive SerDes. There are also wrappers that allow users to run queries that include Hive UDFs, UDAFs, and UDTFs.
- HiveServer and CLI support (sql/hive-thriftserver) - Includes support for the SQL CLI (bin/spark-sql) and a HiveServer2 (for JDBC/ODBC) compatible server.
Running ./sql/create-docs.sh
generates SQL documentation for built-in functions under sql/site
, and SQL configuration documentation that gets included as part of configuration.md
in the main docs
directory.