yiguolei commented on code in PR #65868: URL: https://github.com/apache/doris/pull/65868#discussion_r3645989701
########## regression-test/suites/paimon_write/test_paimon_write_append_only.groovy: ########## @@ -0,0 +1,120 @@ +// 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("test_paimon_write_append_only", "p0,external,paimon") { + String enabled = context.config.otherConfigs.get("enablePaimonTest") + if (enabled == null || !enabled.equalsIgnoreCase("true")) { + logger.info("disable paimon test.") + return + } + + String externalEnvIp = context.config.otherConfigs.get("externalEnvIp") + String minioPort = context.config.otherConfigs.get("iceberg_minio_port") + + String catalogName = "test_pw_ao_catalog" + String dbName = "test_pw_ao_db" + + // Tables are created via Spark because Doris does not yet support + // Paimon DDL (CREATE TABLE ... engine=paimon). + spark_paimon_multi """ + CREATE DATABASE IF NOT EXISTS paimon.${dbName}; + DROP TABLE IF EXISTS paimon.${dbName}.t_append; + CREATE TABLE paimon.${dbName}.t_append ( + id INT, name STRING, score DOUBLE + ) USING paimon; + + DROP TABLE IF EXISTS paimon.${dbName}.t_append_part; + CREATE TABLE paimon.${dbName}.t_append_part ( + id INT, name STRING, score DOUBLE, region STRING + ) USING paimon + PARTITIONED BY (region) + ; + + DROP TABLE IF EXISTS paimon.${dbName}.t_append_empty; + CREATE TABLE paimon.${dbName}.t_append_empty ( + id INT, name STRING + ) USING paimon; + + DROP TABLE IF EXISTS paimon.${dbName}.t_append_default; + CREATE TABLE paimon.${dbName}.t_append_default ( + id INT, name STRING NOT NULL DEFAULT 'unknown' + ) USING paimon; + """ + + sql """drop catalog if exists ${catalogName}""" + sql """ + CREATE CATALOG ${catalogName} PROPERTIES ( + 'type' = 'paimon', + 'paimon.catalog.type' = 'filesystem', + 'warehouse' = 's3://warehouse/wh', + 's3.endpoint' = 'http://${externalEnvIp}:${minioPort}', + 's3.access_key' = 'admin', + 's3.secret_key' = 'password', + 's3.path.style.access' = 'true' + ); + """ + sql """switch ${catalogName}""" + sql """use ${dbName}""" + + try { + def assertTableEquals = { String tableName, String orderBy -> + def sparkRows = spark_paimon """SELECT * FROM paimon.${dbName}.${tableName} ${orderBy}""" + def dorisRows = sql """SELECT * FROM ${tableName} ${orderBy}""" + assertSparkDorisResultEquals(sparkRows, dorisRows) + } + + // FT-001: Append-only table — basic INSERT + sql """INSERT INTO t_append VALUES (1, 'alice', 95.5)""" + sql """INSERT INTO t_append VALUES (2, 'bob', 87.0), (3, 'charlie', 92.3)""" + order_qt_ao_basic """SELECT * FROM t_append ORDER BY id""" + + sql """INSERT INTO t_append VALUES (4, 'diana', 88.0), (5, 'eve', 91.0)""" + // Full-column and partial-column writes with columns in non-schema order + sql """INSERT INTO t_append (score, name, id) VALUES (93.0, 'frank', 6)""" + sql """INSERT INTO t_append (name, id) VALUES ('grace', 7)""" + assertTableEquals("t_append", "ORDER BY id") Review Comment: 这里为什么没有把结果输出,跟out 文件对比呢? -- 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]
