Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
AlterTableSetStmt.java
Go to the documentation of this file.
1
// Copyright 2012 Cloudera Inc.
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
// http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14
15
package
com.cloudera.impala.analysis;
16
17
import
com.cloudera.impala.authorization.Privilege
;
18
import
com.cloudera.impala.catalog.HBaseTable
;
19
import
com.cloudera.impala.catalog.Table
;
20
import
com.cloudera.impala.common.AnalysisException
;
21
25
public
class
AlterTableSetStmt
extends
AlterTableStmt
{
26
protected
final
PartitionSpec
partitionSpec_
;
27
28
public
AlterTableSetStmt
(
TableName
tableName,
PartitionSpec
partitionSpec) {
29
super(tableName);
30
partitionSpec_
= partitionSpec;
31
if
(
partitionSpec_
!= null) partitionSpec_.setTableName(tableName);
32
}
33
34
public
PartitionSpec
getPartitionSpec
() {
return
partitionSpec_
; }
35
36
@Override
37
public
void
analyze
(
Analyzer
analyzer)
throws
AnalysisException
{
38
super.analyze(analyzer);
39
Table
t =
getTargetTable
();
40
// TODO: Support ALTER TABLE SET on HBase tables. Requires validating changes
41
// to the SERDEPROPERTIES and TBLPROPERTIES to ensure the table metadata does not
42
// become invalid.
43
if
(t instanceof
HBaseTable
) {
44
throw
new
AnalysisException
(
"ALTER TABLE SET not currently supported on "
+
45
"HBase tables."
);
46
}
47
48
// Altering the table rather than the partition.
49
if
(
partitionSpec_
== null)
return
;
50
51
partitionSpec_.setPartitionShouldExist();
52
partitionSpec_.setPrivilegeRequirement(
Privilege.ALTER
);
53
partitionSpec_.analyze(analyzer);
54
}
55
}
com.cloudera.impala.catalog.Table
Definition:
Table.java:51
com.cloudera.impala.analysis.AlterTableSetStmt.getPartitionSpec
PartitionSpec getPartitionSpec()
Definition:
AlterTableSetStmt.java:34
com.cloudera.impala.analysis.AlterTableStmt.getTargetTable
Table getTargetTable()
Definition:
AlterTableStmt.java:55
com.cloudera.impala.analysis.TableName
Definition:
TableName.java:33
com.cloudera.impala.common.AnalysisException
Definition:
AnalysisException.java:21
com.cloudera.impala.authorization.Privilege.ALTER
ALTER
Definition:
Privilege.java:26
com.cloudera.impala.analysis.AlterTableSetStmt.AlterTableSetStmt
AlterTableSetStmt(TableName tableName, PartitionSpec partitionSpec)
Definition:
AlterTableSetStmt.java:28
com.cloudera.impala.analysis.AlterTableSetStmt.partitionSpec_
final PartitionSpec partitionSpec_
Definition:
AlterTableSetStmt.java:26
com.cloudera.impala.analysis.AlterTableSetStmt.analyze
void analyze(Analyzer analyzer)
Definition:
AlterTableSetStmt.java:37
com.cloudera.impala.analysis.AlterTableSetStmt
Definition:
AlterTableSetStmt.java:25
com.cloudera.impala.authorization.Privilege
Definition:
Privilege.java:24
com.cloudera.impala.analysis.Analyzer
Definition:
Analyzer.java:105
com.cloudera.impala.analysis.PartitionSpec
Definition:
PartitionSpec.java:24
com.cloudera.impala.catalog.HBaseTable
Definition:
HBaseTable.java:76
com.cloudera.impala.analysis.AlterTableStmt
Definition:
AlterTableStmt.java:29
fe
src
main
java
com
cloudera
impala
analysis
AlterTableSetStmt.java
Generated on Thu May 7 2015 16:10:38 for Impala by
1.8.6