Skip to content

Commit 27e5b6e

Browse files
committed
avoid regression
1 parent 8520124 commit 27e5b6e

File tree

2 files changed

+4
-17
lines changed

2 files changed

+4
-17
lines changed

docs/sql-migration-guide-upgrade.md

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,6 @@ license: |
2424

2525
## Upgrading From Spark SQL 2.4 to 3.0
2626

27-
- Since Spark 3.0, we upgraded the built-in Hive to 2.3 when enabling the Hadoop 3.2+ profile. This upgrade fixes the following issues:
28-
29-
- [HIVE-6727](https://issues.apache.org/jira/browse/HIVE-6727): Table level stats for external tables are set incorrectly.
30-
31-
- [HIVE-15653](https://issues.apache.org/jira/browse/HIVE-15653): Some ALTER TABLE commands drop table stats.
32-
33-
- [SPARK-12014](https://issues.apache.org/jira/browse/SPARK-12014): Spark SQL query containing semicolon is broken in Beeline.
34-
35-
- [SPARK-25193](https://issues.apache.org/jira/browse/SPARK-25193): insert overwrite doesn't throw exception when drop old data fails.
36-
37-
- [SPARK-25919](https://issues.apache.org/jira/browse/SPARK-25919): Date value corrupts when tables are "ParquetHiveSerDe" formatted and target table is Partitioned.
38-
39-
- [SPARK-26332](https://issues.apache.org/jira/browse/SPARK-26332): Spark sql write orc table on viewFS throws exception.
40-
41-
- [SPARK-26437](https://issues.apache.org/jira/browse/SPARK-26437): Decimal data becomes bigint to query, unable to query.
42-
4327
- Since Spark 3.0, the Dataset and DataFrame API `unionAll` is not deprecated any more. It is an alias for `union`.
4428

4529
- In PySpark, when creating a `SparkSession` with `SparkSession.builder.getOrCreate()`, if there is an existing `SparkContext`, the builder was trying to update the `SparkConf` of the existing `SparkContext` with configurations specified to the builder, but the `SparkContext` is shared by all `SparkSession`s, so we should not update them. Since 3.0, the builder comes to not update the configurations. This is the same behavior as Java/Scala API in 2.3 and above. If you want to update them, you need to update them prior to creating a `SparkSession`.

sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveClientImpl.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ import org.apache.spark.sql.catalyst.parser.{CatalystSqlParser, ParseException}
5252
import org.apache.spark.sql.execution.QueryExecutionException
5353
import org.apache.spark.sql.execution.command.DDLUtils
5454
import org.apache.spark.sql.hive.HiveExternalCatalog.{DATASOURCE_SCHEMA, DATASOURCE_SCHEMA_NUMPARTS, DATASOURCE_SCHEMA_PART_PREFIX}
55+
import org.apache.spark.sql.hive.HiveUtils
5556
import org.apache.spark.sql.hive.client.HiveClientImpl._
5657
import org.apache.spark.sql.types._
5758
import org.apache.spark.util.{CircularBuffer, Utils}
@@ -191,7 +192,9 @@ private[hive] class HiveClientImpl(
191192
}
192193

193194
/** Returns the configuration for the current session. */
194-
def conf: HiveConf = {
195+
def conf: HiveConf = if (!HiveUtils.isHive23) {
196+
state.getConf
197+
} else {
195198
val hiveConf = state.getConf
196199
// Hive changed the default of datanucleus.schema.autoCreateAll from true to false
197200
// and hive.metastore.schema.verification from false to true since Hive 2.0.

0 commit comments

Comments
 (0)