-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ANALYZE statement: Analyzer, planner and execution
Extracted-From: prestodb/presto#11376
- Loading branch information
1 parent
82574c8
commit df3f4df
Showing
47 changed files
with
1,161 additions
and
6 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
40 changes: 40 additions & 0 deletions
40
presto-main/src/main/java/io/prestosql/metadata/AnalyzeMetadata.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 io.prestosql.metadata; | ||
|
||
import io.prestosql.spi.statistics.TableStatisticsMetadata; | ||
|
||
import static java.util.Objects.requireNonNull; | ||
|
||
public class AnalyzeMetadata | ||
{ | ||
private final TableStatisticsMetadata statisticsMetadata; | ||
private final TableHandle tableHandle; | ||
|
||
public AnalyzeMetadata(TableStatisticsMetadata statisticsMetadata, TableHandle tableHandle) | ||
{ | ||
this.statisticsMetadata = requireNonNull(statisticsMetadata, "statisticsMetadata is null"); | ||
this.tableHandle = requireNonNull(tableHandle, "tableHandle is null"); | ||
} | ||
|
||
public TableStatisticsMetadata getStatisticsMetadata() | ||
{ | ||
return statisticsMetadata; | ||
} | ||
|
||
public TableHandle getTableHandle() | ||
{ | ||
return tableHandle; | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
presto-main/src/main/java/io/prestosql/metadata/AnalyzePropertyManager.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,25 @@ | ||
/* | ||
* 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.prestosql.metadata; | ||
|
||
import static io.prestosql.spi.StandardErrorCode.INVALID_ANALYZE_PROPERTY; | ||
|
||
public class AnalyzePropertyManager | ||
extends AbstractPropertyManager | ||
{ | ||
public AnalyzePropertyManager() | ||
{ | ||
super("analyze", INVALID_ANALYZE_PROPERTY); | ||
} | ||
} |
87 changes: 87 additions & 0 deletions
87
presto-main/src/main/java/io/prestosql/metadata/AnalyzeTableHandle.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,87 @@ | ||
/* | ||
* 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.prestosql.metadata; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import io.prestosql.connector.ConnectorId; | ||
import io.prestosql.spi.connector.ConnectorTableHandle; | ||
import io.prestosql.spi.connector.ConnectorTransactionHandle; | ||
|
||
import java.util.Objects; | ||
|
||
import static java.util.Objects.requireNonNull; | ||
|
||
public class AnalyzeTableHandle | ||
{ | ||
private final ConnectorId connectorId; | ||
private final ConnectorTransactionHandle transactionHandle; | ||
private final ConnectorTableHandle connectorHandle; | ||
|
||
@JsonCreator | ||
public AnalyzeTableHandle( | ||
@JsonProperty("connectorId") ConnectorId connectorId, | ||
@JsonProperty("transactionHandle") ConnectorTransactionHandle transactionHandle, | ||
@JsonProperty("connectorHandle") ConnectorTableHandle connectorHandle) | ||
{ | ||
this.connectorId = requireNonNull(connectorId, "connectorId is null"); | ||
this.transactionHandle = requireNonNull(transactionHandle, "transactionHandle is null"); | ||
this.connectorHandle = requireNonNull(connectorHandle, "connectorHandle is null"); | ||
} | ||
|
||
@JsonProperty | ||
public ConnectorId getConnectorId() | ||
{ | ||
return connectorId; | ||
} | ||
|
||
@JsonProperty | ||
public ConnectorTableHandle getConnectorHandle() | ||
{ | ||
return connectorHandle; | ||
} | ||
|
||
@JsonProperty | ||
public ConnectorTransactionHandle getTransactionHandle() | ||
{ | ||
return transactionHandle; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) | ||
{ | ||
if (this == o) { | ||
return true; | ||
} | ||
if (o == null || getClass() != o.getClass()) { | ||
return false; | ||
} | ||
AnalyzeTableHandle that = (AnalyzeTableHandle) o; | ||
return Objects.equals(connectorId, that.connectorId) && | ||
Objects.equals(transactionHandle, that.transactionHandle) && | ||
Objects.equals(connectorHandle, that.connectorHandle); | ||
} | ||
|
||
@Override | ||
public int hashCode() | ||
{ | ||
return Objects.hash(connectorId, transactionHandle, connectorHandle); | ||
} | ||
|
||
@Override | ||
public String toString() | ||
{ | ||
return connectorId + ":" + connectorHandle + ":" + transactionHandle; | ||
} | ||
} |
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
Oops, something went wrong.