Modifier and Type | Method and Description |
---|---|
Field |
build()
Creates a
Field object. |
Field.Builder |
setCollation(String collation)
Optional.
|
Field.Builder |
setDefaultValueExpression(String defaultValueExpression)
DefaultValueExpression is used to specify the default value of a field using a SQL
expression.
|
Field.Builder |
setDescription(String description)
Sets the field description.
|
Field.Builder |
setMaxLength(Long maxLength)
Sets the maximum length of the field for STRING or BYTES type.
|
Field.Builder |
setMode(Field.Mode mode)
Sets the mode of the field.
|
Field.Builder |
setName(String name)
Sets the field name.
|
Field.Builder |
setPolicyTags(PolicyTags policyTags)
Sets the policy tags for the field.
|
Field.Builder |
setPrecision(Long precision)
Precision can be used to constrain the maximum number of total digits allowed for NUMERIC or
BIGNUMERIC types.
|
Field.Builder |
setScale(Long scale)
Scale can be used to constrain the maximum number of digits in the fractional part of a
NUMERIC or BIGNUMERIC type.
|
Field.Builder |
setType(LegacySQLTypeName type,
Field... subFields)
Sets the type of the field.
|
Field.Builder |
setType(LegacySQLTypeName type,
FieldList subFields)
Sets the type of the field.
|
Field.Builder |
setType(StandardSQLTypeName type,
Field... subFields)
Sets the type of the field.
|
Field.Builder |
setType(StandardSQLTypeName type,
FieldList subFields)
Sets the type of the field.
|
public Field.Builder setName(String name)
public Field.Builder setType(LegacySQLTypeName type, Field... subFields)
type
- BigQuery data typesubFields
- nested schema fields in case if type
is LegacySQLTypeName.RECORD
, empty otherwiseIllegalArgumentException
- if type == LegacySQLTypeName.RECORD &&
subFields.length == 0
or if type != LegacySQLTypeName.RECORD && subFields.length
!= 0
public Field.Builder setType(StandardSQLTypeName type, Field... subFields)
type
- BigQuery data typesubFields
- nested schema fields in case if type
is StandardSQLTypeName.STRUCT
, empty otherwiseIllegalArgumentException
- if type == StandardSQLTypeName.STRUCT &&
subFields.length == 0
or if type != StandardSQLTypeName.STRUCT &&
subFields.length != 0
public Field.Builder setType(LegacySQLTypeName type, FieldList subFields)
type
- BigQuery data typesubFields
- nested schema fields, in case if type
is LegacySQLTypeName.RECORD
, null
otherwise.IllegalArgumentException
- if type == LegacySQLTypeName.RECORD && (subFields ==
null || subFields.isEmpty())
or if type != LegacySQLTypeName.RECORD && subFields
!= null
public Field.Builder setType(StandardSQLTypeName type, FieldList subFields)
type
- BigQuery data typesubFields
- nested schema fields in case if type
is StandardSQLTypeName.STRUCT
, empty otherwiseIllegalArgumentException
- if type == StandardSQLTypeName.STRUCT &&
subFields.length == 0
or if type != StandardSQLTypeName.STRUCT &&
subFields.length != 0
public Field.Builder setMode(Field.Mode mode)
Field.Mode.NULLABLE
is used.public Field.Builder setDescription(String description)
public Field.Builder setPolicyTags(PolicyTags policyTags)
public Field.Builder setMaxLength(Long maxLength)
It is invalid to set value for types other than STRING or BYTES.
For STRING type, this represents the maximum UTF-8 length of strings allowed in the field. For BYTES type, this represents the maximum number of bytes in the field.
public Field.Builder setScale(Long scale)
public Field.Builder setPrecision(Long precision)
public Field.Builder setDefaultValueExpression(String defaultValueExpression)
You can use struct or array expression to specify default value for the entire struct or array. The valid SQL expressions are:
public Field.Builder setCollation(String collation)
* 'und:ci': undetermined locale, case insensitive. * '': empty string. Default to case-sensitive behavior. (-- A wrapper is used here because it is possible to set the value to the empty string. --)
public Field build()
Field
object.Copyright © 2023 Google LLC. All rights reserved.