Class: AttributeGroup

eclairjs/ml/attribute. AttributeGroup

Attributes that describe a vector ML column. Creates an attribute group with attributes.

Constructor

new AttributeGroup(name, attrs)

Parameters:
Name Type Description
name string name of the attribute group
attrs Array.<Attribute> array of attributes. Attributes will be copied with their corresponding indices in the array.
Source:

Methods

(static) fromStructField(field) → {module:eclairjs/ml/attribute.AttributeGroup}

Creates an attribute group from a StructField instance.
Parameters:
Name Type Description
field module:eclairjs/sql/types.StructField
Source:
Returns:
Type
module:eclairjs/ml/attribute.AttributeGroup

applywithnumber(attrIndex) → {module:eclairjs/sql/catalyst/expressions.Attribute}

Gets an attribute by its index.
Parameters:
Name Type Description
attrIndex number
Source:
Returns:
Type
module:eclairjs/sql/catalyst/expressions.Attribute

applywithstring(attrName) → {module:eclairjs/sql/catalyst/expressions.Attribute}

Gets an attribute by its name.
Parameters:
Name Type Description
attrName string
Source:
Returns:
Type
module:eclairjs/sql/catalyst/expressions.Attribute

getAttrwithnumber(attrIndex) → {module:eclairjs/sql/catalyst/expressions.Attribute}

Gets an attribute by its index.
Parameters:
Name Type Description
attrIndex number
Source:
Returns:
Type
module:eclairjs/sql/catalyst/expressions.Attribute

getAttrwithstring(attrName) → {module:eclairjs/sql/catalyst/expressions.Attribute}

Gets an attribute by its name.
Parameters:
Name Type Description
attrName string
Source:
Returns:
Type
module:eclairjs/sql/catalyst/expressions.Attribute

hasAttr(attrName) → {boolean}

Test whether this attribute group contains a specific attribute.
Parameters:
Name Type Description
attrName string
Source:
Returns:
Type
boolean

indexOf(attrName) → {number}

Index of an attribute specified by name.
Parameters:
Name Type Description
attrName string
Source:
Returns:
Type
number

size() → {number}

Size of the attribute group. Returns -1 if the size is unknown.
Source:
Returns:
Type
number

toMetadata(existingMetadataopt) → {module:eclairjs/sql/types.Metadata}

Converts to ML metadata with some existing metadata.
Parameters:
Name Type Attributes Description
existingMetadata module:eclairjs/sql/types.Metadata <optional>
Source:
Returns:
Type
module:eclairjs/sql/types.Metadata

toStructField(existingMetadataopt) → {module:eclairjs/sql/types.StructField}

Converts to a StructField with some existing metadata.
Parameters:
Name Type Attributes Description
existingMetadata module:eclairjs/sql/types.Metadata <optional>
Source:
Returns:
Type
module:eclairjs/sql/types.StructField