Skip to content

[SPARK-2784][SQL] Deprecate hql() method in favor of a config option, 'spark.sql.dialect' - #1746

Closed
marmbrus wants to merge 3 commits into
apache:masterfrom
marmbrus:sqlLanguageConf
Closed

marmbrus wants to merge 3 commits into
apache:masterfrom
marmbrus:sqlLanguageConf

Conversation

@marmbrus

@marmbrus marmbrus commented Aug 2, 2014

Copy link
Copy Markdown
Contributor

Many users have reported being confused by the distinction between the sql and hql methods. Specifically, many users think that sql(...) cannot be used to read hive tables. In this PR I introduce a new configuration option spark.sql.dialect that picks which dialect with be used for parsing. For SQLContext this must be set to sql. In HiveContext it defaults to hiveql but can also be set to sql.

The hql and hiveql methods continue to act the same but are now marked as deprecated.

This is a possibly breaking change for some users unless they set the dialect manually, though this is unlikely.

For example: hiveContex.sql("SELECT 1") will now throw a parsing exception by default.

@marmbrus

marmbrus commented Aug 2, 2014

Copy link
Copy Markdown
Contributor Author

/cc @pwendell @mateiz @alig

@SparkQA

SparkQA commented Aug 2, 2014

Copy link
Copy Markdown

QA tests have started for PR 1746. This patch merges cleanly.
View progress: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/17789/consoleFull

@SparkQA

SparkQA commented Aug 3, 2014

Copy link
Copy Markdown

QA results for PR 1746:
- This patch FAILED unit tests.
- This patch merges cleanly
- This patch adds the following public classes (experimental):
* into Spark SQL's query functions (i.e. sql()). Otherwise, users of this trait can

For more information see test ouptut:
https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/17789/consoleFull

@yhuai

yhuai commented Aug 3, 2014

Copy link
Copy Markdown
Contributor

LGTM. Two places in the programming guide need to be updated.

.//docs/sql-programming-guide.md:the `sql` method a `JavaHiveContext` also provides an `hql` methods, which allows queries to be
.//docs/sql-programming-guide.md:the `sql` method a `HiveContext` also provides an `hql` methods, which allows queries to be

But, since we will work on doc next week, we can update these in our PR for doc.

Conflicts:
	sql/hive/src/test/scala/org/apache/spark/sql/hive/api/java/JavaHiveQLSuite.scala
	sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveResolutionSuite.scala
	sql/hive/src/test/scala/org/apache/spark/sql/parquet/HiveParquetSuite.scala
@marmbrus

marmbrus commented Aug 3, 2014

Copy link
Copy Markdown
Contributor Author

Github is pretty confused about this one now since apache is lagging...

@SparkQA

SparkQA commented Aug 3, 2014

Copy link
Copy Markdown

QA tests have started for PR 1746. This patch merges cleanly.
View progress: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/17795/consoleFull

@SparkQA

SparkQA commented Aug 3, 2014

Copy link
Copy Markdown

QA results for PR 1746:
- This patch PASSES unit tests.
- This patch merges cleanly
- This patch adds the following public classes (experimental):
* into Spark SQL's query functions (i.e. sql()). Otherwise, users of this trait can

For more information see test ouptut:
https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/17795/consoleFull

@mateiz

mateiz commented Aug 3, 2014

Copy link
Copy Markdown
Contributor

Looks good. Is there a doc with all the SQL config options somewhere too?

@marmbrus

marmbrus commented Aug 3, 2014

Copy link
Copy Markdown
Contributor Author

Thanks for looking at this @mateiz! I'm going to be doing a pretty significant overhaul of the SQL programming guide this week and will make sure to document all the new config options.

@marmbrus

marmbrus commented Aug 3, 2014

Copy link
Copy Markdown
Contributor Author

This has been merged to master and 1.1.

@asfgit asfgit closed this in 236dfac Aug 3, 2014
asfgit pushed a commit that referenced this pull request Aug 3, 2014
… 'spark.sql.dialect'

Many users have reported being confused by the distinction between the `sql` and `hql` methods.  Specifically, many users think that `sql(...)` cannot be used to read hive tables.  In this PR I introduce a new configuration option `spark.sql.dialect` that picks which dialect with be used for parsing.  For SQLContext this must be set to `sql`.  In `HiveContext` it defaults to `hiveql` but can also be set to `sql`.

The `hql` and `hiveql` methods continue to act the same but are now marked as deprecated.

**This is a possibly breaking change for some users unless they set the dialect manually, though this is unlikely.**

For example: `hiveContex.sql("SELECT 1")` will now throw a parsing exception by default.

Author: Michael Armbrust <michael@databricks.com>

Closes #1746 from marmbrus/sqlLanguageConf and squashes the following commits:

ad375cc [Michael Armbrust] Merge remote-tracking branch 'apache/master' into sqlLanguageConf
20c43f8 [Michael Armbrust] override function instead of just setting the value
7e4ae93 [Michael Armbrust] Deprecate hql() method in favor of a config option, 'spark.sql.dialect'

(cherry picked from commit 236dfac)
Signed-off-by: Michael Armbrust <michael@databricks.com>
@marmbrus
marmbrus deleted the sqlLanguageConf branch August 27, 2014 20:56
xiliu82 pushed a commit to xiliu82/spark that referenced this pull request Sep 4, 2014
… 'spark.sql.dialect'

Many users have reported being confused by the distinction between the `sql` and `hql` methods.  Specifically, many users think that `sql(...)` cannot be used to read hive tables.  In this PR I introduce a new configuration option `spark.sql.dialect` that picks which dialect with be used for parsing.  For SQLContext this must be set to `sql`.  In `HiveContext` it defaults to `hiveql` but can also be set to `sql`.

The `hql` and `hiveql` methods continue to act the same but are now marked as deprecated.

**This is a possibly breaking change for some users unless they set the dialect manually, though this is unlikely.**

For example: `hiveContex.sql("SELECT 1")` will now throw a parsing exception by default.

Author: Michael Armbrust <michael@databricks.com>

Closes apache#1746 from marmbrus/sqlLanguageConf and squashes the following commits:

ad375cc [Michael Armbrust] Merge remote-tracking branch 'apache/master' into sqlLanguageConf
20c43f8 [Michael Armbrust] override function instead of just setting the value
7e4ae93 [Michael Armbrust] Deprecate hql() method in favor of a config option, 'spark.sql.dialect'
dongjoon-hyun added a commit that referenced this pull request Nov 2, 2026
### What changes were proposed in this pull request?

This PR aims to upgrade FasterXML Jackson to 2.22.4.

### Why are the changes needed?

Jackson 2.22.4 is the latest patch release on the 2.22 line.

- https://github.com/FasterXML/jackson/wiki/Jackson-Release-2.22.4 (2026-10-17)
  - Streaming
    - [#1683](FasterXML/jackson-core#1683) `ReaderBasedJsonParser` accepts lone surrogates in `\uXXXX` escapes in field names
    - [#1744](FasterXML/jackson-core#1744) `UTF8DataInputJsonParser` fails on JSON-escaped surrogate pairs in property names
    - [#1750](FasterXML/jackson-core#1750) `ALLOW_UNESCAPED_CONTROL_CHARS` is ignored for single-quoted string values in UTF-8 byte parsers
    - [#1742](FasterXML/jackson-core#1742), [#1746](FasterXML/jackson-core#1746), [#1756](FasterXML/jackson-core#1756) Non-blocking parser fixes for escaped surrogate pairs, leading decimal point numbers, and multi-byte UTF-8 characters after a backslash escape
    - [#1730](FasterXML/jackson-core#1730) `FilteringGeneratorDelegate` handles embedded objects, typed arrays, and raw/binary values consistently
  - Databind
    - CVE-2026-110879 [#6287](FasterXML/jackson-databind#6287) Validate type parameters and array element types of type ids
    - [#6206](FasterXML/jackson-databind#6206) Report a cycle through a `JsonValue` accessor as a `DatabindException`
    - [#6227](FasterXML/jackson-databind#6227) `BeanDescription.findProperties()` is not thread-safe on a shared, cached instance
    - [#6249](FasterXML/jackson-databind#6249) Avoid an NPE when the parser reports `VALUE_STRING` with null text
  - CBOR
    - CVE-2026-106554 [#821](FasterXML/jackson-dataformats-binary#821) Grow the `CBORParser.TagList` backing array geometrically

`jackson-annotations` stays at 2.22 as referenced by `jackson-bom` 2.22.4.

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

Pass the CIs.

### Was this patch authored or co-authored using generative AI tooling?

Generated-by: Claude Sonnet 5.5

Closes #60004 from dongjoon-hyun/SPARK-60799.

Authored-by: Dongjoon Hyun <dongjoon@apache.org>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants