/*
* Copyright 2014-2015 the original author or authors
*
* 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.wplatform.ddal.dbobject.table;
import com.wplatform.ddal.command.dml.Select;
import com.wplatform.ddal.command.expression.Expression;
import com.wplatform.ddal.command.expression.ExpressionColumn;
import com.wplatform.ddal.value.Value;
/**
* A column resolver is list of column (for example, a table) that can map a
* column name to an actual column.
*/
public interface ColumnResolver {
/**
* Get the table alias.
*
* @return the table alias
*/
String getTableAlias();
/**
* Get the column list.
*
* @return the column list
*/
Column[] getColumns();
/**
* Get the list of system columns, if any.
*
* @return the system columns or null
*/
Column[] getSystemColumns();
/**
* Get the row id pseudo column, if there is one.
*
* @return the row id column or null
*/
Column getRowIdColumn();
/**
* Get the schema name.
*
* @return the schema name
*/
String getSchemaName();
/**
* Get the value for the given column.
*
* @param column the column
* @return the value
*/
Value getValue(Column column);
/**
* Get the table filter.
*
* @return the table filter
*/
TableFilter getTableFilter();
/**
* Get the select statement.
*
* @return the select statement
*/
Select getSelect();
/**
* Get the expression that represents this column.
*
* @param expressionColumn the expression column
* @param column the column
* @return the optimized expression
*/
Expression optimize(ExpressionColumn expressionColumn, Column column);
}