github-actions[bot] commented on code in PR #63192: URL: https://github.com/apache/doris/pull/63192#discussion_r3229258178
########## regression-test/suites/external_table_p0/tvf/test_local_tvf_iceberg_variant.groovy: ########## @@ -0,0 +1,142 @@ +// 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. + +import java.net.InetAddress +import java.net.NetworkInterface +import java.nio.file.Files +import java.nio.file.StandardCopyOption +import org.apache.doris.regression.action.ProfileAction + +suite("test_local_tvf_iceberg_variant", "p0,external") { + List<List<Object>> backends = sql """ select * from backends(); """ + assertTrue(backends.size() > 0) + + def dataFilePath = context.config.dataPath + "/external_table_p0/tvf/" + def beId = backends[0][0] + def outFilePath = "/" + def unshreddedData = "${dataFilePath}/iceberg_variant_unshredded.parquet" + def shreddedData = "${dataFilePath}/iceberg_variant_shredded.parquet" + + def localHosts = ["localhost", "127.0.0.1", InetAddress.localHost.hostAddress, InetAddress.localHost.hostName] as Set + NetworkInterface.networkInterfaces.each { networkInterface -> + networkInterface.inetAddresses.each { inetAddress -> + localHosts.add(inetAddress.hostAddress) + localHosts.add(inetAddress.hostName) + } + } + + def dorisHome = new File(context.config.dataPath).parentFile.parentFile + def localBeHome = new File(dorisHome, "output/be") + if (backends.size() == 1 && localHosts.contains(backends[0][1]) && localBeHome.exists()) { + Files.copy(new File(unshreddedData).toPath(), new File(localBeHome, "iceberg_variant_unshredded.parquet").toPath(), + StandardCopyOption.REPLACE_EXISTING) + Files.copy(new File(shreddedData).toPath(), new File(localBeHome, "iceberg_variant_shredded.parquet").toPath(), + StandardCopyOption.REPLACE_EXISTING) + } else { + for (List<Object> backend : backends) { + def beHost = backend[1] + scpFiles("root", beHost, unshreddedData, outFilePath, false) + scpFiles("root", beHost, shreddedData, outFilePath, false) + } + } + + def unshredded = outFilePath + "iceberg_variant_unshredded.parquet" Review Comment: This local single-BE branch copies the files to `${dorisHome}/output/be`, but `unshredded` and `shredded` are still built from `outFilePath = "/"`, so the local TVF will try to read `/iceberg_variant_*.parquet` instead of the files just copied under `output/be`. In a local runner where `backends.size() == 1`, the test will fail with file-not-found (or accidentally read a stale root-level file). Please either copy to the same absolute path used by `file_path`, or set the `file_path` variables to the copied `localBeHome` paths in this branch. -- 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]
