If absent, the return type is inferred from definitionBody at query time in each query
that references this routine. If present, then the evaluated result will be cast to the
specified returned type at query time.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-18 UTC."],[],[],null,["# Class RoutineInfo.Builder (2.54.1)\n\nVersion latestkeyboard_arrow_down\n\n- [2.54.1 (latest)](/java/docs/reference/google-cloud-bigquery/latest/com.google.cloud.bigquery.RoutineInfo.Builder)\n- [2.54.0](/java/docs/reference/google-cloud-bigquery/2.54.0/com.google.cloud.bigquery.RoutineInfo.Builder)\n- [2.53.0](/java/docs/reference/google-cloud-bigquery/2.53.0/com.google.cloud.bigquery.RoutineInfo.Builder)\n- [2.52.0](/java/docs/reference/google-cloud-bigquery/2.52.0/com.google.cloud.bigquery.RoutineInfo.Builder)\n- [2.51.0](/java/docs/reference/google-cloud-bigquery/2.51.0/com.google.cloud.bigquery.RoutineInfo.Builder)\n- [2.50.1](/java/docs/reference/google-cloud-bigquery/2.50.1/com.google.cloud.bigquery.RoutineInfo.Builder)\n- [2.49.0](/java/docs/reference/google-cloud-bigquery/2.49.0/com.google.cloud.bigquery.RoutineInfo.Builder)\n- [2.48.1](/java/docs/reference/google-cloud-bigquery/2.48.1/com.google.cloud.bigquery.RoutineInfo.Builder)\n- [2.47.0](/java/docs/reference/google-cloud-bigquery/2.47.0/com.google.cloud.bigquery.RoutineInfo.Builder)\n- [2.46.0](/java/docs/reference/google-cloud-bigquery/2.46.0/com.google.cloud.bigquery.RoutineInfo.Builder)\n- [2.45.0](/java/docs/reference/google-cloud-bigquery/2.45.0/com.google.cloud.bigquery.RoutineInfo.Builder)\n- [2.44.0](/java/docs/reference/google-cloud-bigquery/2.44.0/com.google.cloud.bigquery.RoutineInfo.Builder)\n- [2.43.3](/java/docs/reference/google-cloud-bigquery/2.43.3/com.google.cloud.bigquery.RoutineInfo.Builder)\n- [2.42.3](/java/docs/reference/google-cloud-bigquery/2.42.3/com.google.cloud.bigquery.RoutineInfo.Builder)\n- [2.41.0](/java/docs/reference/google-cloud-bigquery/2.41.0/com.google.cloud.bigquery.RoutineInfo.Builder)\n- [2.40.3](/java/docs/reference/google-cloud-bigquery/2.40.3/com.google.cloud.bigquery.RoutineInfo.Builder)\n- [2.39.1](/java/docs/reference/google-cloud-bigquery/2.39.1/com.google.cloud.bigquery.RoutineInfo.Builder)\n- [2.38.2](/java/docs/reference/google-cloud-bigquery/2.38.2/com.google.cloud.bigquery.RoutineInfo.Builder)\n- [2.37.2](/java/docs/reference/google-cloud-bigquery/2.37.2/com.google.cloud.bigquery.RoutineInfo.Builder)\n- [2.36.0](/java/docs/reference/google-cloud-bigquery/2.36.0/com.google.cloud.bigquery.RoutineInfo.Builder)\n- [2.35.0](/java/docs/reference/google-cloud-bigquery/2.35.0/com.google.cloud.bigquery.RoutineInfo.Builder)\n- [2.34.2](/java/docs/reference/google-cloud-bigquery/2.34.2/com.google.cloud.bigquery.RoutineInfo.Builder)\n- [2.33.2](/java/docs/reference/google-cloud-bigquery/2.33.2/com.google.cloud.bigquery.RoutineInfo.Builder) \n\n public abstract static class RoutineInfo.Builder\n\nInheritance\n-----------\n\n[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \\\u003e RoutineInfo.Builder \n\nInherited Members\n-----------------\n\n[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) \n[Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) \n[Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) \n[Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) \n[Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) \n[Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) \n[Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) \n[Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) \n[Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) \n[Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) \n[Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)\n\nConstructors\n------------\n\n### Builder()\n\n public Builder()\n\nMethods\n-------\n\n### build()\n\n public abstract RoutineInfo build()\n\nCreates a `RoutineInfo` object.\n\n### setArguments(List\\\u003cRoutineArgument\\\u003e argumentList)\n\n public abstract RoutineInfo.Builder setArguments(List\u003cRoutineArgument\u003e argumentList)\n\nSpecifies the list of input/output arguments for the routine.\n\n### setBody(String body)\n\n public abstract RoutineInfo.Builder setBody(String body)\n\nRequired. The body of the routine.\n\nFor functions, this is the expression in the AS clause.\n\nIf language=SQL, it is the substring inside (but excluding) the parentheses. For example,\nfor the function created with the following statement:\n\nCREATE FUNCTION JoinLines(x string, y string) as (concat(x, \"\n\", y))\n\nThe definitionBody is concat(x, \"\n\", y) (\nis not replaced with linebreak).\n\nIf language=JAVASCRIPT, it is the evaluated string in the AS clause. For example, for the\nfunction created with the following statement:\n\nCREATE FUNCTION f() RETURNS STRING LANGUAGE js AS 'return \"\n\";\n'\n\nThe definitionBody is\n\nreturn \"\n\";\n\nNote that both\nare replaced with linebreaks.\n\n### setDataGovernanceType(String dataGovernanceType)\n\n public abstract RoutineInfo.Builder setDataGovernanceType(String dataGovernanceType)\n\nSets the data governance type for the Builder (e.g. DATA_MASKING).\n\nSee \u003chttps://cloud.google.com/bigquery/docs/reference/rest/v2/routines\u003e\n\n### setDeterminismLevel(String determinismLevel)\n\n public abstract RoutineInfo.Builder setDeterminismLevel(String determinismLevel)\n\nSets the JavaScript UDF determinism levels (e.g. DETERMINISM_LEVEL_UNSPECIFIED,\nDETERMINISTIC, NOT_DETERMINISTIC) only applicable to Javascript UDFs.\n\n### setImportedLibraries(List\\\u003cString\\\u003e importedLibrariesList)\n\n public abstract RoutineInfo.Builder setImportedLibraries(List\u003cString\u003e importedLibrariesList)\n\nOptional. If language = \"JAVASCRIPT\", this field stores the path of the imported JAVASCRIPT\nlibraries as a list of gs:// URLs.\n\n### setLanguage(String language)\n\n public abstract RoutineInfo.Builder setLanguage(String language)\n\nSets the language for the routine (e.g. SQL or JAVASCRIPT)\n\n### setRemoteFunctionOptions(RemoteFunctionOptions remoteFunctionOptions)\n\n public abstract RoutineInfo.Builder setRemoteFunctionOptions(RemoteFunctionOptions remoteFunctionOptions)\n\nOptional. Remote function specific options.\n\n### setReturnTableType(StandardSQLTableType returnTableType)\n\n public abstract RoutineInfo.Builder setReturnTableType(StandardSQLTableType returnTableType)\n\nOptional. Set only if Routine is a \"TABLE_VALUED_FUNCTION\".\n\n### setReturnType(StandardSQLDataType returnType)\n\n public abstract RoutineInfo.Builder setReturnType(StandardSQLDataType returnType)\n\nSets the return type of the routine.\n\nOptional if language = \"SQL\"; required otherwise.\n\nIf absent, the return type is inferred from definitionBody at query time in each query\nthat references this routine. If present, then the evaluated result will be cast to the\nspecified returned type at query time.\n\n### setRoutineType(String routineType)\n\n public abstract RoutineInfo.Builder setRoutineType(String routineType)\n\nSets the routine type for the Builder (e.g. SCALAR_FUNCTION).\n\nSee \u003chttps://cloud.google.com/bigquery/docs/reference/rest/v2/routines\u003e"]]