@Override public List<TableName> visit(DerivedTableNode subselectNode) throws SQLException { TableName name = TableName.create(null, subselectNode.getAlias()); return Collections.singletonList(name); } };
public static TableName createNormalized(String schemaName, String tableName) { return new TableName(schemaName, tableName, true); }
public TableName table(String schemaName, String tableName) { return TableName.createNormalized(schemaName,tableName); }
private TableRef resolveTable(String alias, TableName name) throws SQLException { if (alias != null) return resolver.resolveTable(null, alias); return resolver.resolveTable(name.getSchemaName(), name.getTableName()); }
public CreateIndexStatement(NamedNode indexTableName, NamedTableNode dataTable, IndexKeyConstraint indexKeyConstraint, List<ColumnName> includeColumns, List<ParseNode> splits, ListMultimap<String,Pair<String,Object>> props, boolean ifNotExists, IndexType indexType, boolean async, int bindCount, Map<String, UDFParseNode> udfParseNodes) { super(dataTable, bindCount); this.indexTableName =TableName.create(dataTable.getName().getSchemaName(),indexTableName.getName()); this.indexKeyConstraint = indexKeyConstraint == null ? IndexKeyConstraint.EMPTY : indexKeyConstraint; this.includeColumns = includeColumns == null ? Collections.<ColumnName>emptyList() : includeColumns; this.splitNodes = splits == null ? Collections.<ParseNode>emptyList() : splits; this.props = props == null ? ArrayListMultimap.<String,Pair<String,Object>>create() : props; this.ifNotExists = ifNotExists; this.indexType = indexType; this.async = async; this.udfParseNodes = udfParseNodes; }
String tenantId = tenantName == null ? null : tenantName.getString(); TableName tableName = node.getTableName(); if (tableName.getSchemaName() == null && statement.getConnection().getSchema() != null) { tableName = TableName.create(statement.getConnection().getSchema(), tableName.getTableName()); SequenceKey key = new SequenceKey(tenantId, tableName.getSchemaName(), tableName.getTableName(), nSaltBuckets); SequenceValueExpression expression = sequenceMap.get(key); if (expression == null) {
protected TableRef createTableRef(String connectionSchemaName, NamedTableNode tableNode, boolean updateCacheImmediately, boolean alwaysHitServer) throws SQLException { String tableName = tableNode.getName().getTableName(); String schemaName = tableNode.getName().getSchemaName(); schemaName = connection.getSchema() != null && schemaName == null ? connection.getSchema() : schemaName; long timeStamp = QueryConstants.UNSET_TIMESTAMP; tableNode.getName().equals(mutatingTableName) ){ alwaysHitServer = true;
TableWildcardParseNode(TableName tableName, boolean isRewrite) { super(tableName.toString()); this.tableName = tableName; this.isRewrite = isRewrite; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; SequenceValueParseNode other = (SequenceValueParseNode) obj; if (op != other.op) return false; if (tableName == null) { if (other.tableName != null) return false; } else if (!tableName.equals(other.tableName)) return false; return true; }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((name == null) ? 0 : name.hashCode()); result = prime * result + ((tableSamplingRate == null) ? 0 : tableSamplingRate.hashCode()); return result; }
public String getSchemaName() { return tableName == null ? null : tableName.getSchemaName(); }
public boolean isTableNameCaseSensitive() { return tableName == null ? false : tableName.isTableNameCaseSensitive(); }
public String getTableName() { return tableName == null ? null : tableName.getTableName(); }
private TableRef resolveTable(String alias, TableName name) throws SQLException { if (alias != null) return origResolver.resolveTable(null, alias); return origResolver.resolveTable(name.getSchemaName(), name.getTableName()); }
if ( state.backtracking==0 ) {ret = factory.alterIndex(factory.namedTable(null, TableName.create(t.getSchemaName(), i.getName())), t.getTableName(), ex!=null, PIndexState.valueOf(SchemaUtil.normalizeIdentifier(s.getText())), async!=null, p); }
protected TableRef createTableRef(String connectionSchemaName, NamedTableNode tableNode, boolean updateCacheImmediately, boolean alwaysHitServer) throws SQLException { String tableName = tableNode.getName().getTableName(); String schemaName = tableNode.getName().getSchemaName(); schemaName = connection.getSchema() != null && schemaName == null ? connection.getSchema() : schemaName; long timeStamp = QueryConstants.UNSET_TIMESTAMP; tableNode.getName().equals(mutatingTableName) ){ alwaysHitServer = true;
@Override public void toSQL(ColumnResolver resolver, StringBuilder buf) { buf.append(this.getName().toString()); if (this.getAlias() != null) buf.append(" " + this.getAlias()); buf.append(' '); } }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; ConcreteTableNode other = (ConcreteTableNode)obj; if (name == null) { if (other.name != null) return false; } else if (!name.equals(other.name)) return false; if (tableSamplingRate == null) { if (other.tableSamplingRate != null) return false; } else if (!tableSamplingRate.equals(other.tableSamplingRate)) return false; return true; } }
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + (isRewrite ? 1231 : 1237); result = prime * result + ((tableName == null) ? 0 : tableName.hashCode()); return result; }
protected CreateTableStatement(TableName tableName, ListMultimap<String,Pair<String,Object>> props, List<ColumnDef> columns, PrimaryKeyConstraint pkConstraint, List<ParseNode> splitNodes, PTableType tableType, boolean ifNotExists, TableName baseTableName, ParseNode whereClause, int bindCount, Boolean immutableRows) { this.tableName = tableName; this.props = props == null ? ImmutableListMultimap.<String,Pair<String,Object>>of() : props; this.tableType = PhoenixDatabaseMetaData.SYSTEM_CATALOG_SCHEMA.equals(tableName.getSchemaName()) ? PTableType.SYSTEM : tableType; this.columns = columns == null ? ImmutableList.<ColumnDef>of() : ImmutableList.<ColumnDef>copyOf(columns); this.pkConstraint = pkConstraint == null ? PrimaryKeyConstraint.EMPTY : pkConstraint; this.splitNodes = splitNodes == null ? Collections.<ParseNode>emptyList() : ImmutableList.copyOf(splitNodes); this.bindCount = bindCount; this.ifNotExists = ifNotExists; this.baseTableName = baseTableName; this.whereClause = whereClause; this.immutableRows = immutableRows; }