cloud-fan commented on a change in pull request #30154: URL: https://github.com/apache/spark/pull/30154#discussion_r518536897
########## File path: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/jdbc/JDBCTableCatalog.scala ########## @@ -117,14 +118,37 @@ class JDBCTableCatalog extends TableCatalog with Logging { if (partitions.nonEmpty) { throw new UnsupportedOperationException("Cannot create JDBC table with partition") } - // TODO (SPARK-32405): Apply table options while creating tables in JDBC Table Catalog + + var tableOptions = options.parameters + (JDBCOptions.JDBC_TABLE_NAME -> getTableName(ident)) + var tableComment: String = "" + var tableProperties: String = "" if (!properties.isEmpty) { - logWarning("Cannot create JDBC table with properties, these properties will be " + - "ignored: " + properties.asScala.map { case (k, v) => s"$k=$v" }.mkString("[", ", ", "]")) + properties.asScala.map { + case (k, v) => k match { + case "comment" => tableComment = v + // ToDo: have a follow up to fail provider once unify create table syntax PR is merged + case "provider" => + case "owner" => // owner is ignored. It is default to current user name. + case "location" => + throw new AnalysisException("Cannot create JDBC table with property location.") Review comment: let's be more user-facing: `CREATE TABLE ... LOCATION ... is not supported in the JDBC catalog.` ---------------------------------------------------------------- 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: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org