Class: Polars::Catalog::Unity::TableInfo

Inherits:
Struct
  • Object
show all
Defined in:
lib/polars/catalog/unity/table_info.rb,
lib/polars/catalog/unity/table_info.rb

Overview

Information for a catalog table.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#columnsObject

Returns the value of attribute columns

Returns:

  • (Object)

    the current value of columns



5
6
7
# File 'lib/polars/catalog/unity/table_info.rb', line 5

def columns
  @columns
end

#commentObject

Returns the value of attribute comment

Returns:

  • (Object)

    the current value of comment



5
6
7
# File 'lib/polars/catalog/unity/table_info.rb', line 5

def comment
  @comment
end

#created_atObject

Returns the value of attribute created_at

Returns:

  • (Object)

    the current value of created_at



5
6
7
# File 'lib/polars/catalog/unity/table_info.rb', line 5

def created_at
  @created_at
end

#created_byObject

Returns the value of attribute created_by

Returns:

  • (Object)

    the current value of created_by



5
6
7
# File 'lib/polars/catalog/unity/table_info.rb', line 5

def created_by
  @created_by
end

#data_source_formatObject

Returns the value of attribute data_source_format

Returns:

  • (Object)

    the current value of data_source_format



5
6
7
# File 'lib/polars/catalog/unity/table_info.rb', line 5

def data_source_format
  @data_source_format
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



5
6
7
# File 'lib/polars/catalog/unity/table_info.rb', line 5

def name
  @name
end

#propertiesObject

Returns the value of attribute properties

Returns:

  • (Object)

    the current value of properties



5
6
7
# File 'lib/polars/catalog/unity/table_info.rb', line 5

def properties
  @properties
end

#storage_locationObject

Returns the value of attribute storage_location

Returns:

  • (Object)

    the current value of storage_location



5
6
7
# File 'lib/polars/catalog/unity/table_info.rb', line 5

def storage_location
  @storage_location
end

#table_idObject

Returns the value of attribute table_id

Returns:

  • (Object)

    the current value of table_id



5
6
7
# File 'lib/polars/catalog/unity/table_info.rb', line 5

def table_id
  @table_id
end

#table_typeObject

Returns the value of attribute table_type

Returns:

  • (Object)

    the current value of table_type



5
6
7
# File 'lib/polars/catalog/unity/table_info.rb', line 5

def table_type
  @table_type
end

#updated_atObject

Returns the value of attribute updated_at

Returns:

  • (Object)

    the current value of updated_at



5
6
7
# File 'lib/polars/catalog/unity/table_info.rb', line 5

def updated_at
  @updated_at
end

#updated_byObject

Returns the value of attribute updated_by

Returns:

  • (Object)

    the current value of updated_by



5
6
7
# File 'lib/polars/catalog/unity/table_info.rb', line 5

def updated_by
  @updated_by
end

Instance Method Details

#get_polars_schemaSchema

Note:

This functionality is considered unstable. It may be changed at any point without it being considered a breaking change.

Get the native polars schema of this table.

Returns:



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/polars/catalog/unity/table_info.rb', line 30

def get_polars_schema
  if columns.nil?
    return nil
  end

  schema = Schema.new(check_dtypes: false)

  columns.each do |column_info|
    if schema[column_info.name]
      msg = "duplicate column name: #{column_info.name}"
      raise DuplicateError, msg
    end
    schema[column_info.name] = column_info.get_polars_dtype
  end

  schema
end