beliefer commented on code in PR #49564: URL: https://github.com/apache/spark/pull/49564#discussion_r1928250961
########## sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCSuite.scala: ########## @@ -2206,4 +2206,44 @@ class JDBCSuite extends QueryTest with SharedSparkSession { JdbcUtils.schemaString(dialect, schema, caseSensitive = false, Some("b boolean")) assert(schemaStr === """"b" NUMBER(1) """) } + + test("SPARK-50666: reading hint test") { + // JDBC url is a required option but is not used in this test. + val options = new JDBCOptions(Map("url" -> "jdbc:h2://host:port", "dbtable" -> "test", + "hint" -> "/*+ INDEX(test idx1) */")) + // hint supported + assert( + OracleDialect() + .getJdbcSQLQueryBuilder(options) + .withColumns(Array("a", "b")) + .build() + .trim() == "SELECT /*+ INDEX(test idx1) */ a,b FROM test") + assert( + MySQLDialect() + .getJdbcSQLQueryBuilder(options) + .withColumns(Array("a", "b")) + .build() + .trim() == "SELECT /*+ INDEX(test idx1) */ a,b FROM test") Review Comment: ``` Seq(OracleDialect(), MySQLDialect()).foreach { dialect => dialect .getJdbcSQLQueryBuilder(options) .withColumns(Array("a", "b")) .build() .trim() == "SELECT /*+ INDEX(test idx1) */ a,b FROM test") } ``` -- 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. To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org 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