VoltDB/voltdb — pull request #97 by paulmartel (2012-07-31 17:49:23+00:00)
Title: Eng 3009

Aside from implementing the EXTRACT functions, this changeset contains the following "cleanup":

Establish a single value EXPRESSION_TYPE_FUNCTION as the one ExpressionType for all FunctionExpression objects vs. having to define another EXPRESSION_TYPE per function.
Use/extend/propagate through the planner existing HSQL-isms for identifying functions and modeling function type parameterizations, eliminating redundant mechanisms in the planner.
ee/common/NValue.hpp
ee/common/types.cpp
ee/common/types.h
ee/expressions/expressionutil.cpp
ee/expressions/expressionutil.h
ee/expressions/functionexpression.cpp
ee/expressions/functionexpression.h
frontend/org/voltdb/expressions/FunctionExpression.java
frontend/org/voltdb/planner/AbstractParsedStmt.java
DELETED frontend/org/voltdb/planner/SQLFunction.java
frontend/org/voltdb/types/ExpressionType.java
hsqldb19b3/org/hsqldb_voltpatches/FunctionCustom.java
hsqldb19b3/org/hsqldb_voltpatches/FunctionForVoltDB.java
hsqldb19b3/org/hsqldb_voltpatches/FunctionSQL.java
tests/ee/common/nvalue_test.cpp
tests/ee/storage/filter_test.cpp

Group SQL function implementations into manageably sized source files -- remove from the commonly included header to avoid re-compile.
ee/common/NValue.hpp
ee/expressions/functionexpression.cpp
ee/expressions/functionexpression.h
ee/expressions/numericfunctions.h
ee/expressions/stringfunctions.h

Support a dummy SQL_ERROR function that purposely exercises the SQLException code path, for testing and demo purposes.
ee/common/SQLException.cpp
ee/common/SQLException.h

Support type conversion for the HSQL "CHARACTER" type (which does seem to occur) as opposed to "CHAR" type (which doesn't seem to occur, at least in our tests?).
frontend/org/voltdb/HsqlBackend.java
frontend/org/voltdb/VoltType.java
tests/frontend/org/voltdb/TestVoltType.java

Fix a one-line wrong answer (off by X 1,000,000) conversion error passing Timestamp params into the HSQL backend.
frontend/org/voltdb/HsqlBackend.java

Migrate AbstractExpression behaviors out of ExpressionUtil UBER-methods and AbstractExpression class methods for specifying/specializing expression types,
fixing this behavior for (parameterized) FunctionExpressions.
frontend/org/voltdb/expressions/AbstractExpression.java
frontend/org/voltdb/expressions/AbstractValueExpression.java
frontend/org/voltdb/expressions/AggregateExpression.java
frontend/org/voltdb/expressions/ComparisonExpression.java
frontend/org/voltdb/expressions/ConjunctionExpression.java
frontend/org/voltdb/expressions/ConstantValueExpression.java
frontend/org/voltdb/expressions/ExpressionUtil.java
frontend/org/voltdb/expressions/FunctionExpression.java
frontend/org/voltdb/expressions/InComparisonExpression.java
frontend/org/voltdb/expressions/OperatorExpression.java
frontend/org/voltdb/planner/ParsedDeleteStmt.java
frontend/org/voltdb/planner/ParsedInsertStmt.java
frontend/org/voltdb/planner/ParsedSelectStmt.java
frontend/org/voltdb/planner/ParsedUpdateStmt.java
tests/frontend/org/voltdb/expressions/TestExpressionUtil.java

Eliminate cases of throwing and catching "false alarm" parser exceptions for normal recoverable code paths, making it easier to debug actual exceptions.
hsqldb19b3/org/hsqldb_voltpatches/SchemaManager.java
hsqldb19b3/org/hsqldb_voltpatches/Session.java
hsqldb19b3/org/hsqldb_voltpatches/StatementSchemaDefinition.java
hsqldb19b3/org/hsqldb_voltpatches/ParserDQL.java