Tabnine Logo
CreateFunctionStatement
Code IndexAdd Tabnine to your IDE (free)

How to use
CreateFunctionStatement
in
org.apache.asterix.lang.common.statement

Best Java code snippets using org.apache.asterix.lang.common.statement.CreateFunctionStatement (Showing top 5 results out of 315)

origin: apache/asterixdb

@Override
public Void visit(CreateFunctionStatement cfs, Integer step) throws CompilationException {
  out.print(skip(step) + CREATE + " function ");
  out.print(generateIfNotExists(cfs.getIfNotExists()));
  out.print(
      this.generateFullName(cfs.getFunctionSignature().getNamespace(), cfs.getFunctionSignature().getName()));
  out.print("(");
  printDelimitedStrings(cfs.getParamList(), COMMA);
  out.println(") {");
  out.println(cfs.getFunctionBody());
  out.println("}" + SEMICOLON);
  out.println();
  return null;
}
origin: apache/asterixdb

protected void handleCreateFunctionStatement(MetadataProvider metadataProvider, Statement stmt) throws Exception {
  CreateFunctionStatement cfs = (CreateFunctionStatement) stmt;
  SourceLocation sourceLoc = cfs.getSourceLocation();
  FunctionSignature signature = cfs.getFunctionSignature();
  String dataverse = getActiveDataverseName(signature.getNamespace());
  signature.setNamespace(dataverse);
    Query wrappedQuery = new Query(false);
    wrappedQuery.setSourceLocation(sourceLoc);
    wrappedQuery.setBody(cfs.getFunctionBodyExpression());
    wrappedQuery.setTopLevel(false);
    List<VarIdentifier> paramVars = new ArrayList<>();
    for (String v : cfs.getParamList()) {
      paramVars.add(new VarIdentifier(v));
        rewriterFactory.createQueryRewriter(), cfs.getFunctionBodyExpression(), metadataProvider);
    Function function = new Function(signature, cfs.getParamList(), Function.RETURNTYPE_VOID,
        cfs.getFunctionBody(), getFunctionLanguage(), FunctionKind.SCALAR.toString(), dependencies);
    MetadataManager.INSTANCE.addFunction(mdTxnCtx, function);
origin: apache/asterixdb

final public CreateFunctionStatement FunctionSpecification() throws ParseException, ParseException {
FunctionSignature signature;
boolean ifNotExists = false;
List<VarIdentifier> paramList = new ArrayList<VarIdentifier>();
String functionBody;
VarIdentifier var = null;
Expression functionBodyExpr;
Token beginPos;
Token endPos;
FunctionName fctName = null;
createNewScope();
 jj_consume_token(FUNCTION);
 fctName = FunctionName();
 ifNotExists = IfNotExists();
 paramList = ParameterList();
 jj_consume_token(LEFTBRACE);
  beginPos = token;
 functionBodyExpr = Expression();
 jj_consume_token(RIGHTBRACE);
  endPos = token;
  functionBody = extractFragment(beginPos.beginLine, beginPos.beginColumn, endPos.beginLine, endPos.beginColumn);
  // TODO use fctName.library
  signature = new FunctionSignature(fctName.dataverse, fctName.function, paramList.size());
  getCurrentScope().addFunctionDescriptor(signature, false);
  removeCurrentScope();
  {if (true) return new CreateFunctionStatement(signature, paramList, functionBody, functionBodyExpr, ifNotExists);}
 throw new Error("Missing return statement in function");
}
origin: apache/asterixdb

final public CreateFunctionStatement FunctionSpecification() throws ParseException, ParseException {
FunctionSignature signature;
boolean ifNotExists = false;
List<VarIdentifier> paramList = new ArrayList<VarIdentifier>();
String functionBody;
VarIdentifier var = null;
Expression functionBodyExpr;
Token beginPos;
Token endPos;
FunctionName fctName = null;
createNewScope();
 jj_consume_token(FUNCTION);
 fctName = FunctionName();
 ifNotExists = IfNotExists();
 paramList = ParameterList();
 jj_consume_token(LEFTBRACE);
  beginPos = token;
 functionBodyExpr = Expression();
 jj_consume_token(RIGHTBRACE);
  endPos = token;
  functionBody = extractFragment(beginPos.beginLine, beginPos.beginColumn, endPos.beginLine, endPos.beginColumn);
  // TODO use fctName.library
  signature = new FunctionSignature(fctName.dataverse, fctName.function, paramList.size());
  getCurrentScope().addFunctionDescriptor(signature, false);
  removeCurrentScope();
  {if (true) return new CreateFunctionStatement(signature, paramList, functionBody, functionBodyExpr, ifNotExists);}
 throw new Error("Missing return statement in function");
}
origin: apache/asterixdb

 removeCurrentScope();
 defaultDataverse = currentDataverse;
 CreateFunctionStatement stmt = new CreateFunctionStatement(signature, paramList, functionBody, functionBodyExpr, ifNotExists);
 {if (true) return addSourceLocation(stmt, startStmtToken);}
throw new Error("Missing return statement in function");
org.apache.asterix.lang.common.statementCreateFunctionStatement

Most used methods

  • <init>
  • getFunctionBody
  • getFunctionSignature
  • getParamList
  • getFunctionBodyExpression
  • getIfNotExists
  • getSourceLocation

Popular in Java

  • Making http requests using okhttp
  • onRequestPermissionsResult (Fragment)
  • getExternalFilesDir (Context)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • Join (org.hibernate.mapping)
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now