Skip to content

Attribute — Base of Leaf Named Expressions

Attribute is the <> of <>.

NOTE: catalyst/QueryPlan.md#output[QueryPlan uses Attributes] to build the schema of the query (it represents).

[[contract]] [source, scala]


package org.apache.spark.sql.catalyst.expressions

abstract class Attribute extends ... { // only required properties (vals and methods) that have no implementation // the others follow def withMetadata(newMetadata: Metadata): Attribute def withName(newName: String): Attribute def withNullability(newNullability: Boolean): Attribute def withQualifier(newQualifier: Option[String]): Attribute def newInstance(): Attribute }


.Attribute Contract [cols="1m,2",options="header",width="100%"] |=== | Property | Description

| withMetadata | [[withMetadata]]

| withName | [[withName]]

| withNullability | [[withNullability]]

| withQualifier | [[withQualifier]]

| newInstance | [[newInstance]] |===

[[references]] When requested for <>, Attribute gives the reference to itself only.

[[toAttribute]] As a <>, Attribute gives the reference to itself only when requested for <>.

[[extensions]] .Attributes (Direct Implementations) [cols="1,2",options="header",width="100%"] |=== | Attribute | Description

| <> | [[AttributeReference]]

| <> | [[PrettyAttribute]]

| <> | [[UnresolvedAttribute]] |===

As an optimization, Attribute is marked as to not tolerate nulls, and when given a null input produces a null output.


Last update: 2021-05-30
Back to top