commit | aaaabd446b9442710dde21355f2544e34bfa5894 | [log] [tgz] |
---|---|---|
author | buyingyi <buyingyi@eaa15691-b419-025a-1212-ee371bd00084> | Thu Nov 29 04:47:28 2012 +0000 |
committer | buyingyi <buyingyi@eaa15691-b419-025a-1212-ee371bd00084> | Thu Nov 29 04:47:28 2012 +0000 |
tree | 6a7c718f0d70b02e65eea1fb552eb2e4b320c06a | |
parent | 373765e8eeef84caddeab7f059b2cd50d2c943c9 [diff] |
add more comments git-svn-id: https://asterixdb.googlecode.com/svn/branches/asterix_stabilization_printerfix@964 eaa15691-b419-025a-1212-ee371bd00084
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/ConstantFoldingRule.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/ConstantFoldingRule.java index 4a1f1fa..769ede3 100644 --- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/ConstantFoldingRule.java +++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/ConstantFoldingRule.java
@@ -174,6 +174,7 @@ if (expr.getFunctionIdentifier().equals(AsterixBuiltinFunctions.UNORDERED_LIST_CONSTRUCTOR) || expr.getFunctionIdentifier().equals(AsterixBuiltinFunctions.ORDERED_LIST_CONSTRUCTOR)) { AbstractCollectionType listType = (AbstractCollectionType) TypeComputerUtilities.getRequiredType(expr); + // do not fold open lists nor nested lists if (listType != null && (listType.getItemType().getTypeTag() == ATypeTag.ANY || listType.getItemType() instanceof AbstractCollectionType)) { return new Pair<Boolean, ILogicalExpression>(false, null);
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/typecast/StaticTypeCastUtil.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/typecast/StaticTypeCastUtil.java index a361b48..7be6936 100644 --- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/typecast/StaticTypeCastUtil.java +++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/typecast/StaticTypeCastUtil.java
@@ -202,6 +202,15 @@ return true; } + /** + * This method statically cast the type of records from their current type to the required type. + * + * @param func The record constructor expression. + * @param reqType The required type. + * @param inputType The current type. + * @param env The type environment. + * @throws AlgebricksException + */ private static void staticRecordTypeCast(AbstractFunctionCallExpression func, ARecordType reqType, ARecordType inputType, IVariableTypeEnvironment env) throws AlgebricksException { IAType[] reqFieldTypes = reqType.getFieldTypes();