morningman commented on code in PR #60556:
URL: https://github.com/apache/doris/pull/60556#discussion_r2788762203


##########
regression-test/suites/external_table_p0/paimon/paimon_data_system_table.groovy:
##########
@@ -0,0 +1,75 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+suite("paimon_data_system_table", 
"p0,external,doris,external_docker,external_docker_doris") {
+
+    String enabled = context.config.otherConfigs.get("enablePaimonTest")
+    if (enabled == null || !enabled.equalsIgnoreCase("true")) {
+        logger.info("disabled paimon test")
+        return
+    }
+
+    String catalogName = "paimon_data_system_table"
+    String dbName = "test_paimon_spark"
+    String tableName = "data_sys_table"
+    String appendTableName = "data_sys_table_append"
+    String minioPort = context.config.otherConfigs.get("iceberg_minio_port")
+    String externalEnvIp = context.config.otherConfigs.get("externalEnvIp")
+
+    try {
+        sql """drop catalog if exists ${catalogName}"""
+        sql """CREATE CATALOG ${catalogName} PROPERTIES (
+                'type'='paimon',
+                'warehouse' = 's3://warehouse/wh/',
+                "s3.access_key" = "admin",
+                "s3.secret_key" = "password",
+                "s3.endpoint" = "http://${externalEnvIp}:${minioPort}";,
+                "s3.region" = "us-east-1"
+            );"""
+
+        logger.info("catalog " + catalogName + " created")
+        sql """switch ${catalogName};"""
+        logger.info("switched to catalog " + catalogName)
+        sql """use ${dbName};"""
+        logger.info("use " + dbName)
+
+        List<List<Object>> paimonTableList = sql """show tables;"""
+        boolean targetTableExists = paimonTableList.any { row ->
+            row.size() > 0 && row[0].toString().equals(tableName)
+        }
+        assertTrue(targetTableExists, "Target table '${tableName}' not found 
in database '${dbName}'")
+        boolean appendTableExists = paimonTableList.any { row ->
+            row.size() > 0 && row[0].toString().equals(appendTableName)
+        }
+        assertTrue(appendTableExists, "Target table '${appendTableName}' not 
found in database '${dbName}'")
+
+        qt_base_table_count """select count(*) from ${tableName}"""
+        qt_base_table_rows """select id, name from ${tableName} order by id"""
+
+        qt_audit_log_count """select count(*) from ${tableName}\$audit_log"""
+        qt_audit_log_rows """select rowkind, id, name from 
${tableName}\$audit_log order by id"""
+        qt_binlog_count """select count(*) from ${tableName}\$binlog"""
+        qt_binlog_rows """select rowkind, id[1], name[1] from 
${tableName}\$binlog order by id[1]"""
+
+        qt_append_table_count """select count(*) from ${appendTableName}"""
+        qt_append_table_rows """select id, name from ${appendTableName} order 
by id"""
+
+        qt_append_ro_table_count """select count(*) from 
${appendTableName}\$ro"""
+        qt_append_ro_table_rows """select id, name from ${appendTableName}\$ro 
order by id"""

Review Comment:
   We need to test the result of explain SQL, to see if it use native data 
split correctly.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to