cloud-fan commented on a change in pull request #29712:
URL: https://github.com/apache/spark/pull/29712#discussion_r487047278
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/DataSourceUtils.scala
##########
@@ -190,4 +194,33 @@ object DataSourceUtils {
case LegacyBehaviorPolicy.LEGACY =>
RebaseDateTime.rebaseGregorianToJulianMicros
case LegacyBehaviorPolicy.CORRECTED => identity[Long]
}
+
+ def generateDatasourceOptions(
+ extraOptionsMap: CaseInsensitiveStringMap, table: CatalogTable):
Map[String, String] = {
+ val pathOption = table.storage.locationUri.map("path" ->
CatalogUtils.URIToString(_))
+ val options = table.storage.properties ++ pathOption
+ if (!SQLConf.get.getConf(SQLConf.LEGACY_EXTRA_OPTIONS_BEHAVIOR)) {
+ // Check the same key with different values
+ table.storage.properties.foreach { case (k, v) =>
+ if (extraOptionsMap.containsKey(k) && extraOptionsMap.get(k) != v) {
+ throw new AnalysisException(
+ s"Fail to create datasource for the table
${table.identifier.table} since the table " +
Review comment:
`create datasource` -> `resolve data source`
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]