Github user fhueske commented on a diff in the pull request: https://github.com/apache/flink/pull/3406#discussion_r104194149 --- Diff: flink-libraries/flink-table/src/test/scala/org/apache/flink/table/utils/CommonTestData.scala --- @@ -68,6 +62,90 @@ object CommonTestData { ) } + def getMockedFlinkExternalCatalog: ExternalCatalog = { + val csvRecord1 = Seq( + "1#1#Hi", + "2#2#Hello", + "3#2#Hello world" + ) + val tempFilePath1 = writeToTempFile(csvRecord1.mkString("$"), "csv-test1", "tmp") + val externalCatalogTable1 = ExternalCatalogTable( + TableIdentifier("db1", "tb1"), + "csv", + DataSchema( + Array( + BasicTypeInfo.INT_TYPE_INFO, + BasicTypeInfo.LONG_TYPE_INFO, + BasicTypeInfo.STRING_TYPE_INFO), + Array("a", "b", "c") + ), + properties = Map( + "path" -> tempFilePath1, + "fieldDelim" -> "#", + "rowDelim" -> "$" + ) + ) + + val csvRecord2 = Seq( + "1#1#0#Hallo#1", + "2#2#1#Hallo Welt#2", + "2#3#2#Hallo Welt wie#1", + "3#4#3#Hallo Welt wie gehts?#2", + "3#5#4#ABC#2", + "3#6#5#BCD#3", + "4#7#6#CDE#2", + "4#8#7#DEF#1", + "4#9#8#EFG#1", + "4#10#9#FGH#2", + "5#11#10#GHI#1", + "5#12#11#HIJ#3", + "5#13#12#IJK#3", + "5#14#13#JKL#2", + "5#15#14#KLM#2" + ) + val tempFilePath2 = writeToTempFile(csvRecord2.mkString("$"), "csv-test2", "tmp") + val externalCatalogTable2 = ExternalCatalogTable( + TableIdentifier("db2", "tb2"), + "csv", + DataSchema( + Array( + BasicTypeInfo.INT_TYPE_INFO, + BasicTypeInfo.LONG_TYPE_INFO, + BasicTypeInfo.INT_TYPE_INFO, + BasicTypeInfo.STRING_TYPE_INFO, + BasicTypeInfo.LONG_TYPE_INFO), + Array("d", "e", "f", "g", "h") + ), + properties = Map( + "path" -> tempFilePath2, + "fieldDelim" -> "#", + "rowDelim" -> "$" + ) + ) + val catalog = mock(classOf[ExternalCatalog]) --- End diff -- Couldn't we use the `InMemoryExternalCatalog` here instead of mocking one?
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---