@Test public void testImplicitConstantDouble() throws SqlException { functions.add(new FunctionFactory() { @Override public String getSignature() { return "x()"; } @Override public Function newInstance(ObjList<Function> args, int position, CairoConfiguration configuration1) { return new DoubleFunction(position) { @Override public double getDouble(Record rec) { return 0; } @Override public boolean isConstant() { return true; } }; } }); Function function = parseFunction("x()", new GenericRecordMetadata(), createFunctionParser()); Assert.assertTrue(function instanceof DoubleConstant); }
public Function parseFunction( ExpressionNode node, RecordMetadata metadata, SqlExecutionContext executionContext ) throws SqlException { this.sqlExecutionContext = executionContext; if (this.metadata != null) { metadataStack.push(this.metadata); } try { this.metadata = metadata; traverseAlgo.traverse(node, this); return stack.poll(); } finally { if (metadataStack.size() == 0) { this.metadata = null; } else { this.metadata = metadataStack.poll(); } } }
FunctionParser implements PostOrderTreeTraversalAlgo.Visitor { public Function parseFunction( ExpressionNode node, RecordMetadata metadata, SqlExecutionContext executionContext ) throws SqlException { this.sqlExecutionContext = executionContext; if (this.metadata != null) { metadataStack.push(this.metadata); } try { this.metadata = metadata; traverseAlgo.traverse(node, this); return stack.poll(); } finally { if (metadataStack.size() == 0) { this.metadata = null; } else { this.metadata = metadataStack.poll(); } } } }
FunctionParser implements PostOrderTreeTraversalAlgo.Visitor { public Function parseFunction( ExpressionNode node, RecordMetadata metadata, SqlExecutionContext executionContext ) throws SqlException { this.sqlExecutionContext = executionContext; if (this.metadata != null) { metadataStack.push(this.metadata); } try { this.metadata = metadata; traverseAlgo.traverse(node, this); return stack.poll(); } finally { if (metadataStack.size() == 0) { this.metadata = null; } else { this.metadata = metadataStack.poll(); } } } FunctionParser(CairoConfiguration configuration, FunctionFactoryCache functionFactoryCache); }
FunctionParser implements PostOrderTreeTraversalAlgo.Visitor { public Function parseFunction( ExpressionNode node, RecordMetadata metadata, SqlExecutionContext executionContext ) throws SqlException { this.sqlExecutionContext = executionContext; if (this.metadata != null) { metadataStack.push(this.metadata); } try { this.metadata = metadata; traverseAlgo.traverse(node, this); return stack.poll(); } finally { if (metadataStack.size() == 0) { this.metadata = null; } else { this.metadata = metadataStack.poll(); } } } FunctionParser(CairoConfiguration configuration, FunctionFactoryCache functionFactoryCache); static int getArgType(char c); static int validateSignatureAndGetNameSeparator(String sig); Function createIndexParameter(int variableIndex, ExpressionNode node); Function createNamedParameter(ExpressionNode node); Function parseFunction(
            ExpressionNode node,
            RecordMetadata metadata,
            SqlExecutionContext executionContext
    ); void setSqlCodeGenerator(SqlCodeGenerator sqlCodeGenerator); @Override void visit(ExpressionNode node); boolean isGroupBy(CharSequence token); int getFunctionCount(); }
FunctionParser implements PostOrderTreeTraversalAlgo.Visitor { public Function parseFunction( ExpressionNode node, RecordMetadata metadata, SqlExecutionContext executionContext ) throws SqlException { this.sqlExecutionContext = executionContext; if (this.metadata != null) { metadataStack.push(this.metadata); } try { this.metadata = metadata; traverseAlgo.traverse(node, this); return stack.poll(); } finally { if (metadataStack.size() == 0) { this.metadata = null; } else { this.metadata = metadataStack.poll(); } } } FunctionParser(CairoConfiguration configuration, FunctionFactoryCache functionFactoryCache); static int getArgType(char c); static int validateSignatureAndGetNameSeparator(String sig); Function createIndexParameter(int variableIndex, ExpressionNode node); Function createNamedParameter(ExpressionNode node); Function parseFunction(
            ExpressionNode node,
            RecordMetadata metadata,
            SqlExecutionContext executionContext
    ); void setSqlCodeGenerator(SqlCodeGenerator sqlCodeGenerator); @Override void visit(ExpressionNode node); boolean isGroupBy(CharSequence token); int getFunctionCount();  }