caican00 commented on code in PR #5722: URL: https://github.com/apache/gravitino/pull/5722#discussion_r1885659209
########## spark-connector/spark-common/src/test/java/org/apache/gravitino/spark/connector/integration/test/paimon/SparkPaimonCatalogIT.java: ########## @@ -0,0 +1,119 @@ +/* + * 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. + */ +package org.apache.gravitino.spark.connector.integration.test.paimon; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import org.apache.gravitino.spark.connector.integration.test.SparkCommonIT; +import org.apache.gravitino.spark.connector.integration.test.util.SparkTableInfo; +import org.apache.gravitino.spark.connector.integration.test.util.SparkTableInfoChecker; +import org.apache.gravitino.spark.connector.paimon.PaimonPropertiesConstants; +import org.apache.hadoop.fs.Path; +import org.apache.spark.sql.types.DataTypes; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +public abstract class SparkPaimonCatalogIT extends SparkCommonIT { + + @Override + protected String getCatalogName() { + return "paimon"; + } + + @Override + protected String getProvider() { + return "lakehouse-paimon"; + } + + @Override + protected boolean supportsSparkSQLClusteredBy() { + return false; + } + + @Override + protected boolean supportsPartition() { + return true; + } + + @Override + protected boolean supportsDelete() { + return false; + } + + @Override + protected boolean supportsSchemaEvolution() { + return true; + } + + @Override + protected boolean supportsReplaceColumns() { + // Paimon doesn't support replace columns, because it doesn't support drop all fields in table. + // And `ALTER TABLE REPLACE COLUMNS` statement will removes all existing columns at first and + // then adds the new set of columns. + return false; + } + + @Override + protected String getTableLocation(SparkTableInfo table) { + Map<String, String> tableProperties = table.getTableProperties(); + return tableProperties.get(PaimonPropertiesConstants.PAIMON_TABLE_LOCATION); + } + + @Test + void testPaimonPartitions() { Review Comment: The partition field of hive must be placed at the end of the columns in order, but paimon's can be placed anywhere. -- 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]
