-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrading the kudu client revealed a few problems: 1. Timeouts to kudu tablets were sometimes occurring during deletes due to a bug in the kudu java client in version 1.13.0. 2. Timeouts were *not* failing query execution because the kudu connector was configured to flush operations in the background. 3. The two combined above meant tests that did deletes sometimes actually did not perform deletes and would fail. This patch upgrades the kudu client, explicitly fails trino execution when kudu rpcs timeout, and marks unsupported data types from kudu 1.15.0.
- Loading branch information
1 parent
a6f75d8
commit 103dbcf
Showing
16 changed files
with
175 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
plugin/trino-kudu/src/main/java/org/apache/kudu/client/KuduOperationApplier.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Licensed 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.kudu.client; | ||
|
||
import io.trino.spi.TrinoException; | ||
|
||
import static io.trino.spi.StandardErrorCode.GENERIC_INTERNAL_ERROR; | ||
import static java.lang.String.format; | ||
|
||
/** | ||
* Operation.getChangeType() is package private | ||
*/ | ||
public final class KuduOperationApplier | ||
{ | ||
private KuduOperationApplier() | ||
{ | ||
} | ||
|
||
public static OperationResponse applyOperationAndVerifySucceeded(KuduSession kuduSession, Operation operation) | ||
throws KuduException | ||
{ | ||
OperationResponse operationResponse = kuduSession.apply(operation); | ||
if (operationResponse != null && operationResponse.hasRowError()) { | ||
throw new TrinoException(GENERIC_INTERNAL_ERROR, format("Error while applying kudu operation %s: %s", | ||
operation.getChangeType().toString(), operationResponse.getRowError())); | ||
} | ||
return operationResponse; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
plugin/trino-kudu/src/test/java/io/trino/plugin/kudu/KuduLatestSmokeTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* Licensed 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 io.trino.plugin.kudu; | ||
|
||
public class KuduLatestSmokeTests | ||
{ | ||
private static final String KUDU_VERSION = "1.15.0"; | ||
|
||
public static class TestKuduSmokeTestWithDisabledInferSchema | ||
extends AbstractKuduSmokeTestWithDisabledInferSchema | ||
{ | ||
@Override | ||
protected String getKuduServerVersion() | ||
{ | ||
return KUDU_VERSION; | ||
} | ||
} | ||
|
||
public static class TestKuduSmokeTestWithEmptyInferSchema | ||
extends AbstractKuduSmokeTestWithEmptyInferSchema | ||
{ | ||
@Override | ||
protected String getKuduServerVersion() | ||
{ | ||
return KUDU_VERSION; | ||
} | ||
} | ||
|
||
public static class TestKuduSmokeTestWithStandardInferSchema | ||
extends AbstractKuduSmokeTestWithStandardInferSchema | ||
{ | ||
@Override | ||
protected String getKuduServerVersion() | ||
{ | ||
return KUDU_VERSION; | ||
} | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
plugin/trino-kudu/src/test/java/io/trino/plugin/kudu/KuduSmokeTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* Licensed 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 io.trino.plugin.kudu; | ||
|
||
public class KuduSmokeTests | ||
{ | ||
private static final String KUDU_VERSION = "1.13.0"; | ||
|
||
public static class TestKuduSmokeTestWithDisabledInferSchema | ||
extends AbstractKuduSmokeTestWithDisabledInferSchema | ||
{ | ||
@Override | ||
protected String getKuduServerVersion() | ||
{ | ||
return KUDU_VERSION; | ||
} | ||
} | ||
|
||
public static class TestKuduSmokeTestWithEmptyInferSchema | ||
extends AbstractKuduSmokeTestWithEmptyInferSchema | ||
{ | ||
@Override | ||
protected String getKuduServerVersion() | ||
{ | ||
return KUDU_VERSION; | ||
} | ||
} | ||
|
||
public static class TestKuduSmokeTestWithStandardInferSchema | ||
extends AbstractKuduSmokeTestWithStandardInferSchema | ||
{ | ||
@Override | ||
protected String getKuduServerVersion() | ||
{ | ||
return KUDU_VERSION; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters