forked from prestodb/presto
-
Notifications
You must be signed in to change notification settings - Fork 0
Clp integration fix #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
wraymo
wants to merge
7
commits into
master
Choose a base branch
from
clp_integration_fix
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
0566292
Add CLP connector
wraymo e9a9140
apply review suggestions
wraymo 7b31240
Add a dummy ClpRecordSetProvider implementation and fix ClpMySqlMetad…
wraymo e7b3bc6
Fixed incorrect configuration options
wraymo 550e448
1. Remove kqlQuery and schemaTableName from ClpSplit, rename archiveP…
wraymo 7ca1179
1. use singleton for ClpPlanOptimizerProvider
wraymo f664d82
Merge remote-tracking branch 'origin/master' into clp_integration_fix
wraymo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,128 @@ | ||
<?xml version="1.0"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>com.facebook.presto</groupId> | ||
<artifactId>presto-root</artifactId> | ||
<version>0.293-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>presto-clp</artifactId> | ||
<description>Presto - CLP Connector</description> | ||
<packaging>presto-plugin</packaging> | ||
|
||
<properties> | ||
<air.main.basedir>${project.parent.basedir}</air.main.basedir> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>com.mysql</groupId> | ||
<artifactId>mysql-connector-j</artifactId> | ||
<scope>runtime</scope> | ||
</dependency> | ||
wraymo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
<dependency> | ||
<groupId>com.facebook.airlift</groupId> | ||
<artifactId>bootstrap</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>com.facebook.airlift</groupId> | ||
<artifactId>json</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>com.facebook.airlift</groupId> | ||
<artifactId>log</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>com.facebook.airlift</groupId> | ||
<artifactId>configuration</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>com.google.inject</groupId> | ||
<artifactId>guice</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>com.google.guava</groupId> | ||
<artifactId>guava</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>javax.inject</groupId> | ||
<artifactId>javax.inject</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>com.fasterxml.jackson.core</groupId> | ||
<artifactId>jackson-annotations</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>com.facebook.presto</groupId> | ||
<artifactId>presto-spi</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>com.facebook.presto</groupId> | ||
<artifactId>presto-common</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>io.airlift</groupId> | ||
<artifactId>units</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>io.airlift</groupId> | ||
<artifactId>slice</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.testng</groupId> | ||
<artifactId>testng</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>com.facebook.presto</groupId> | ||
<artifactId>presto-main-base</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>com.facebook.presto</groupId> | ||
<artifactId>presto-analyzer</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>com.h2database</groupId> | ||
<artifactId>h2</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>com.facebook.presto</groupId> | ||
<artifactId>presto-parser</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.apache.commons</groupId> | ||
<artifactId>commons-math3</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
</project> |
117 changes: 117 additions & 0 deletions
117
presto-clp/src/main/java/com/facebook/presto/plugin/clp/ClpColumnHandle.java
This file contains hidden or 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,117 @@ | ||
/* | ||
* 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 com.facebook.presto.plugin.clp; | ||
|
||
import com.facebook.presto.common.type.Type; | ||
import com.facebook.presto.spi.ColumnHandle; | ||
import com.facebook.presto.spi.ColumnMetadata; | ||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
import java.util.Objects; | ||
|
||
import static com.google.common.base.MoreObjects.toStringHelper; | ||
|
||
public class ClpColumnHandle | ||
implements ColumnHandle | ||
{ | ||
private final String columnName; | ||
private final String originalColumnName; | ||
private final Type columnType; | ||
private final boolean nullable; | ||
|
||
@JsonCreator | ||
public ClpColumnHandle( | ||
@JsonProperty("columnName") String columnName, | ||
@JsonProperty("originalColumnName") String originalColumnName, | ||
@JsonProperty("columnType") Type columnType, | ||
@JsonProperty("nullable") boolean nullable) | ||
{ | ||
this.columnName = columnName; | ||
this.originalColumnName = originalColumnName; | ||
this.columnType = columnType; | ||
this.nullable = nullable; | ||
} | ||
|
||
public ClpColumnHandle(String columnName, Type columnType, boolean nullable) | ||
{ | ||
this(columnName, columnName, columnType, nullable); | ||
} | ||
|
||
@JsonProperty | ||
public String getColumnName() | ||
{ | ||
return columnName; | ||
} | ||
|
||
@JsonProperty | ||
public String getOriginalColumnName() | ||
{ | ||
return originalColumnName; | ||
} | ||
|
||
@JsonProperty | ||
public Type getColumnType() | ||
{ | ||
return columnType; | ||
} | ||
|
||
@JsonProperty | ||
public boolean isNullable() | ||
{ | ||
return nullable; | ||
} | ||
|
||
public ColumnMetadata getColumnMetadata() | ||
{ | ||
ColumnMetadata.Builder builder = ColumnMetadata.builder() | ||
.setName(columnName) | ||
.setType(columnType) | ||
.setNullable(nullable); | ||
return builder.build(); | ||
} | ||
|
||
@Override | ||
public int hashCode() | ||
{ | ||
return Objects.hash(columnName, originalColumnName, columnType, nullable); | ||
} | ||
|
||
@Override | ||
public boolean equals(Object obj) | ||
{ | ||
if (this == obj) { | ||
return true; | ||
} | ||
if (obj == null || getClass() != obj.getClass()) { | ||
return false; | ||
wraymo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
ClpColumnHandle other = (ClpColumnHandle) obj; | ||
return Objects.equals(this.columnName, other.columnName) && | ||
Objects.equals(this.originalColumnName, other.originalColumnName) && | ||
Objects.equals(this.columnType, other.columnType) && | ||
Objects.equals(this.nullable, other.nullable); | ||
wraymo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
|
||
@Override | ||
public String toString() | ||
{ | ||
return toStringHelper(this) | ||
.add("columnName", columnName) | ||
.add("originalColumnName", originalColumnName) | ||
.add("columnType", columnType) | ||
.add("nullable", nullable) | ||
.toString(); | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.