-
Notifications
You must be signed in to change notification settings - Fork 29.1k
[SPARK-55645][SQL][FOLLOWUP] Move serdeName to last parameter and filter empty strings #54860
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -177,23 +177,23 @@ private[hive] class HiveMetastoreCatalog(sparkSession: SparkSession) extends Log | |
| val options = storage.properties + (ParquetOptions.MERGE_SCHEMA -> | ||
| SQLConf.get.getConf(HiveUtils.CONVERT_METASTORE_PARQUET_WITH_SCHEMA_MERGING).toString) | ||
| storage.copy( | ||
| serdeName = None, | ||
| serde = None, | ||
| properties = options | ||
| properties = options, | ||
| serdeName = None | ||
| ) | ||
| } else { | ||
| val options = storage.properties | ||
| if (SQLConf.get.getConf(SQLConf.ORC_IMPLEMENTATION) == "native") { | ||
| storage.copy( | ||
| serdeName = None, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same question as line 180. |
||
| serde = None, | ||
| properties = options | ||
| properties = options, | ||
| serdeName = None | ||
| ) | ||
| } else { | ||
| storage.copy( | ||
| serdeName = None, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same question as line 180. |
||
| serde = None, | ||
| properties = options | ||
| properties = options, | ||
| serdeName = None | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -557,11 +557,11 @@ private[hive] class HiveClientImpl( | |
| outputFormat = Option(h.getTTable.getSd.getOutputFormat).orElse { | ||
| Option(h.getStorageHandler).map(_.getOutputFormatClass.getName) | ||
| }, | ||
| serdeName = Option(h.getTTable.getSd.getSerdeInfo.getName), | ||
| serde = Option(h.getSerializationLib), | ||
| compressed = h.getTTable.getSd.isCompressed, | ||
| properties = Option(h.getTTable.getSd.getSerdeInfo.getParameters) | ||
| .map(_.asScala.toMap).orNull | ||
| .map(_.asScala.toMap).orNull, | ||
| serdeName = Option(h.getTTable.getSd.getSerdeInfo.getName).filter(_.nonEmpty) | ||
| ), | ||
| // For EXTERNAL_TABLE, the table properties has a particular field "EXTERNAL". This is added | ||
| // in the function toHiveTable. | ||
|
|
@@ -1202,7 +1202,7 @@ private[hive] object HiveClientImpl extends Logging { | |
| hiveTable.getTTable.getSd.setLocation(loc)} | ||
| table.storage.inputFormat.map(toInputFormat).foreach(hiveTable.setInputFormatClass) | ||
| table.storage.outputFormat.map(toOutputFormat).foreach(hiveTable.setOutputFormatClass) | ||
| table.storage.serdeName.foreach(hiveTable.getSd.getSerdeInfo.setName) | ||
| table.storage.serdeName.foreach(hiveTable.getTTable.getSd.getSerdeInfo.setName) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. minor: found all other places use |
||
| hiveTable.setSerializationLib( | ||
| table.storage.serde.getOrElse("org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe")) | ||
| table.storage.properties.foreach { case (k, v) => hiveTable.setSerdeParam(k, v) } | ||
|
|
@@ -1283,11 +1283,11 @@ private[hive] object HiveClientImpl extends Logging { | |
| locationUri = Option(CatalogUtils.stringToURI(apiPartition.getSd.getLocation)), | ||
| inputFormat = Option(apiPartition.getSd.getInputFormat), | ||
| outputFormat = Option(apiPartition.getSd.getOutputFormat), | ||
| serdeName = Option(apiPartition.getSd.getSerdeInfo.getName), | ||
| serde = Option(apiPartition.getSd.getSerdeInfo.getSerializationLib), | ||
| compressed = apiPartition.getSd.isCompressed, | ||
| properties = Option(apiPartition.getSd.getSerdeInfo.getParameters) | ||
| .map(_.asScala.toMap).orNull), | ||
| .map(_.asScala.toMap).orNull, | ||
| serdeName = Option(apiPartition.getSd.getSerdeInfo.getName).filter(_.nonEmpty)), | ||
| createTime = apiPartition.getCreateTime.toLong * 1000, | ||
| lastAccessTime = apiPartition.getLastAccessTime.toLong * 1000, | ||
| parameters = properties, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry if this change was not correct in the original PR, but doesn't unsetting
serdeNamematch the sentiment of unsettingserdehere?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's just a name for display, so does not really matter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but still better to clear it.