Class: Google::Apis::LoggingV2::FieldSource

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/logging_v2/classes.rb,
lib/google/apis/logging_v2/representations.rb,
lib/google/apis/logging_v2/representations.rb

Overview

A source that can be used to represent a "field of data" within various parts of a structured query, such as in SELECT, WHERE, or ORDER BY clauses. The term "field of data" is used here because it is not limited to literal fields in the underlying data schema.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ FieldSource

Returns a new instance of FieldSource.



963
964
965
# File 'lib/google/apis/logging_v2/classes.rb', line 963

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#alias_refString

The alias name for a field that has already been aliased within a different ProjectedField type elsewhere in the query model. The alias must be defined in the QueryBuilderConfig's field_sources list, otherwise the model is invalid. Corresponds to the JSON property aliasRef

Returns:

  • (String)


907
908
909
# File 'lib/google/apis/logging_v2/classes.rb', line 907

def alias_ref
  @alias_ref
end

#column_typeString

The type of the selected field. This comes from the schema. Can be one of the BigQuery data types: - STRING - INT64 - FLOAT64 - BOOL - TIMESTAMP - DATE - RECORD - JSON Corresponds to the JSON property columnType

Returns:

  • (String)


914
915
916
# File 'lib/google/apis/logging_v2/classes.rb', line 914

def column_type
  @column_type
end

#fieldString

The fully qualified, dot-delimited path to the selected atomic field (the leaf value). This path is used for primary selection and actions like drill-down or projection.The path components should match the exact field names or keys as they appear in the underlying data schema. For JSON fields, this means respecting the original casing (e.g., camelCase or snake_case as present in the JSON).To reference field names containing special characters (e.g., hyphens, spaces), enclose the individual path segment in backticks (). Examples: * json_payload.labels.message * json_payload.request_id * httpRequest.status * json_payload.\my-custom-field.value *jsonPayload.my key with spaces.data Corresponds to the JSON propertyfield`

Returns:

  • (String)


928
929
930
# File 'lib/google/apis/logging_v2/classes.rb', line 928

def field
  @field
end

#is_jsonBoolean Also known as: is_json?

Whether the field is a JSON field, or has a parent that is a JSON field. This value is used to determine JSON extractions in generated SQL queries. Note that this is_json flag may be true when the column_type is not JSON if the parent is a JSON field. Ex: - A json_payload.message field might have is_json= true, since the 'json_payload' parent is of type JSON, and columnType='STRING' if the 'message' field is of type STRING. Corresponds to the JSON property isJson

Returns:

  • (Boolean)


938
939
940
# File 'lib/google/apis/logging_v2/classes.rb', line 938

def is_json
  @is_json
end

#parent_pathString

The dot-delimited path of the parent container that holds the target field. This path defines the structural hierarchy and is essential for correctly generating SQL when field keys contain special characters (e.g., dots or brackets).Example: json_payload.labels (This points to the 'labels' object). This is an empty string if the target field is at the root level. Corresponds to the JSON property parentPath

Returns:

  • (String)


948
949
950
# File 'lib/google/apis/logging_v2/classes.rb', line 948

def parent_path
  @parent_path
end

#projected_fieldGoogle::Apis::LoggingV2::ProjectedField

Represents a field selected in the query, analogous to an item in a SQL SELECT clause. It specifies the source field and optionally applies transformations like aggregation, casting, regex extraction, or assigns an alias. Use ProjectedField when you need more than just the raw source field name (for which you might use FieldSource directly in QueryBuilderConfig's field_sources list if no transformations or specific operation type are needed).A ProjectedField can represent either a field present in the data schema ( specified via the field property) or a virtual field that is computed from other fields (specified via the virtual_field property). Corresponds to the JSON property projectedField



961
962
963
# File 'lib/google/apis/logging_v2/classes.rb', line 961

def projected_field
  @projected_field
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



968
969
970
971
972
973
974
975
# File 'lib/google/apis/logging_v2/classes.rb', line 968

def update!(**args)
  @alias_ref = args[:alias_ref] if args.key?(:alias_ref)
  @column_type = args[:column_type] if args.key?(:column_type)
  @field = args[:field] if args.key?(:field)
  @is_json = args[:is_json] if args.key?(:is_json)
  @parent_path = args[:parent_path] if args.key?(:parent_path)
  @projected_field = args[:projected_field] if args.key?(:projected_field)
end