voonhous commented on code in PR #20043:
URL: https://github.com/apache/hudi/pull/20043#discussion_r4133148419
##########
hudi-trino/src/test/java/io/trino/plugin/hudi/TestingHudiPlugin.java:
##########
@@ -14,30 +14,35 @@
package io.trino.plugin.hudi;
import com.google.common.collect.ImmutableList;
+import io.trino.spi.Plugin;
import io.trino.spi.connector.ConnectorFactory;
import java.nio.file.Path;
-import java.util.List;
+import java.util.Optional;
-import static com.google.common.base.Verify.verify;
import static java.util.Objects.requireNonNull;
public class TestingHudiPlugin
- extends HudiPlugin
+ implements Plugin
{
- private final Path localFileSystemRootPath;
+ private final Optional<Path> localFileSystemRootPath;
+
+ public TestingHudiPlugin()
+ {
+ this.localFileSystemRootPath = Optional.empty();
+ }
public TestingHudiPlugin(Path localFileSystemRootPath)
{
- this.localFileSystemRootPath = requireNonNull(localFileSystemRootPath,
"localFileSystemRootPath is null");
+ this.localFileSystemRootPath =
Optional.of(requireNonNull(localFileSystemRootPath, "localFileSystemRootPath is
null"));
}
@Override
public Iterable<ConnectorFactory> getConnectorFactories()
{
- List<ConnectorFactory> connectorFactories =
ImmutableList.copyOf(super.getConnectorFactories());
- verify(connectorFactories.size() == 1, "Unexpected connector
factories: %s", connectorFactories);
-
- return ImmutableList.of(new
TestingHudiConnectorFactory(localFileSystemRootPath));
+ if (localFileSystemRootPath.isPresent()) {
+ return ImmutableList.of(new
TestingHudiConnectorFactory(localFileSystemRootPath.get()));
+ }
Review Comment:
`TestHudiConnectorFactory.assertCreateConnector` already calls `new
HudiConnectorFactory().create(...)` with the same two keys
(`hive.metastore.uri` + `bootstrap.quiet`), then goes further: begins a
transaction, asserts the metadata / split-manager / page-source types, and
covers the invalid-URI cases. A bad binding or a newly required config would
fail there.
The only things `TestHudiPlugin` did on top were go through the now-deleted
one-line `HudiPlugin` wrapper and call `shutdown()`, which every query-runner
test still exercises on close. Nothing is lost by removing it.
--
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]