|
17 | 17 |
|
18 | 18 | package org.apache.kyuubi.engine.flink.operation
|
19 | 19 |
|
| 20 | +import java.sql.DatabaseMetaData |
| 21 | + |
20 | 22 | import org.apache.flink.table.api.EnvironmentSettings.DEFAULT_BUILTIN_CATALOG
|
21 | 23 | import org.apache.flink.table.api.EnvironmentSettings.DEFAULT_BUILTIN_DATABASE
|
22 | 24 | import org.apache.flink.table.types.logical.LogicalTypeRoot
|
@@ -330,14 +332,14 @@ class FlinkOperationSuite extends WithFlinkSQLEngine with HiveJDBCTestHelper {
|
330 | 332 | val metaData = statement.getConnection.getMetaData
|
331 | 333 | var resultSet = metaData.getSchemas(null, null)
|
332 | 334 | while (resultSet.next()) {
|
333 |
| - assert(resultSet.getString(TABLE_SCHEM) == DEFAULT_BUILTIN_DATABASE) |
| 335 | + assert(resultSet.getString(TABLE_SCHEM) === DEFAULT_BUILTIN_DATABASE) |
334 | 336 | assert(resultSet.getString(TABLE_CATALOG) === DEFAULT_BUILTIN_CATALOG)
|
335 | 337 | }
|
336 | 338 | resultSet = metaData.getSchemas(
|
337 | 339 | DEFAULT_BUILTIN_CATALOG.split("_").apply(0),
|
338 | 340 | DEFAULT_BUILTIN_DATABASE.split("_").apply(0))
|
339 | 341 | while (resultSet.next()) {
|
340 |
| - assert(resultSet.getString(TABLE_SCHEM) == DEFAULT_BUILTIN_DATABASE) |
| 342 | + assert(resultSet.getString(TABLE_SCHEM) === DEFAULT_BUILTIN_DATABASE) |
341 | 343 | assert(resultSet.getString(TABLE_CATALOG) === DEFAULT_BUILTIN_CATALOG)
|
342 | 344 | }
|
343 | 345 | }
|
@@ -412,26 +414,28 @@ class FlinkOperationSuite extends WithFlinkSQLEngine with HiveJDBCTestHelper {
|
412 | 414 | val metaData = statement.getConnection.getMetaData
|
413 | 415 | Seq("currentTimestamp", "currentDate", "currentTime", "localTimestamp", "localTime")
|
414 | 416 | .foreach { func =>
|
415 |
| - Seq(metaData.getFunctions _).foreach { apiFunc => |
416 |
| - val resultSet = apiFunc(null, null, func) |
417 |
| - while (resultSet.next()) { |
418 |
| - assert(resultSet.getString(FUNCTION_CAT) == null) |
419 |
| - assert(resultSet.getString(FUNCTION_SCHEM) === null) |
420 |
| - assert(resultSet.getString(FUNCTION_NAME) === func) |
421 |
| - } |
| 417 | + val resultSet = metaData.getFunctions(null, null, func) |
| 418 | + while (resultSet.next()) { |
| 419 | + assert(resultSet.getString(FUNCTION_CAT) === null) |
| 420 | + assert(resultSet.getString(FUNCTION_SCHEM) === null) |
| 421 | + assert(resultSet.getString(FUNCTION_NAME) === func) |
| 422 | + assert(resultSet.getString(REMARKS) === null) |
| 423 | + assert(resultSet.getInt(FUNCTION_TYPE) === DatabaseMetaData.functionResultUnknown) |
| 424 | + assert(resultSet.getString(SPECIFIC_NAME) === null) |
422 | 425 | }
|
423 | 426 | }
|
424 | 427 | val expected =
|
425 | 428 | List("currentTimestamp", "currentDate", "currentTime", "localTimestamp", "localTime")
|
426 | 429 | Seq("current", "local")
|
427 | 430 | .foreach { funcPattern =>
|
428 |
| - Seq(metaData.getFunctions _).foreach { apiFunc => |
429 |
| - val resultSet = apiFunc(null, null, funcPattern) |
430 |
| - while (resultSet.next()) { |
431 |
| - assert(resultSet.getString(FUNCTION_CAT) == null) |
432 |
| - assert(resultSet.getString(FUNCTION_SCHEM) === null) |
433 |
| - assert(expected.contains(resultSet.getString(FUNCTION_NAME))) |
434 |
| - } |
| 431 | + val resultSet = metaData.getFunctions(null, null, funcPattern) |
| 432 | + while (resultSet.next()) { |
| 433 | + assert(resultSet.getString(FUNCTION_CAT) === null) |
| 434 | + assert(resultSet.getString(FUNCTION_SCHEM) === null) |
| 435 | + assert(expected.contains(resultSet.getString(FUNCTION_NAME))) |
| 436 | + assert(resultSet.getString(REMARKS) === null) |
| 437 | + assert(resultSet.getString(FUNCTION_TYPE) === DatabaseMetaData.functionResultUnknown) |
| 438 | + assert(resultSet.getString(SPECIFIC_NAME) === null) |
435 | 439 | }
|
436 | 440 | }
|
437 | 441 | }
|
|
0 commit comments