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 within various parts of a structured query, such as in SELECT, WHERE, or ORDER BY clauses.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ FieldSource

Returns a new instance of FieldSource.



958
959
960
# File 'lib/google/apis/logging_v2/classes.rb', line 958

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)


905
906
907
# File 'lib/google/apis/logging_v2/classes.rb', line 905

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)


912
913
914
# File 'lib/google/apis/logging_v2/classes.rb', line 912

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)


926
927
928
# File 'lib/google/apis/logging_v2/classes.rb', line 926

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)


936
937
938
# File 'lib/google/apis/logging_v2/classes.rb', line 936

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)


946
947
948
# File 'lib/google/apis/logging_v2/classes.rb', line 946

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). Corresponds to the JSON property projectedField



956
957
958
# File 'lib/google/apis/logging_v2/classes.rb', line 956

def projected_field
  @projected_field
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



963
964
965
966
967
968
969
970
# File 'lib/google/apis/logging_v2/classes.rb', line 963

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