com.choreograph.tyda

Members list

Type members

Classlikes

sealed trait AdditiveExpr[T]

Attributes

Companion
object
Source
AdditiveExpr.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object AdditiveExpr

Attributes

Companion
trait
Source
AdditiveExpr.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
final class AggregateExpr[T] extends Selectable

An expression that represents an aggregated value.

An expression that represents an aggregated value.

This class is closely related to Expr, and supports most of the same operations. But contains some aggregate expression and can therefore only be used in Dataset.aggregate and GroupedDataset.aggregate.

Use aggregate functions in aggregates to create instances from Expr.

Attributes

Companion
object
Source
AggregateExpr.scala
Supertypes
trait Selectable
class Object
trait Matchable
class Any

Attributes

Companion
class
Source
AggregateExpr.scala
Supertypes
class Object
trait Matchable
class Any
Self type
object AllSingletons

Attributes

Source
AllSingletons.scala
Supertypes
class Object
trait Matchable
class Any
Self type
sealed trait Arbitrary[T]

Attributes

Companion
object
Source
Arbitrary.scala
Supertypes
class Object
trait Matchable
class Any
object Arbitrary

Attributes

Companion
trait
Source
Arbitrary.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Arbitrary.type
object Arity

Attributes

Source
Arity.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Arity.type
trait AsExprOrExplode[T, R] extends Conversion[T, Expr[R] | ExplodeExpr[R]]

Attributes

Companion
object
Source
AsExprOrExplode.scala
Supertypes
class Conversion[T, Expr[R] | ExplodeExpr[R]]
trait T => Expr[R] | ExplodeExpr[R]
class Object
trait Matchable
class Any

Attributes

Companion
trait
Source
AsExprOrExplode.scala
Supertypes
class Object
trait Matchable
class Any
Self type
object Binary

Attributes

Source
Binary.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Binary.type
object BuildInfo

Generated by sbt

Generated by sbt

Attributes

Source
BuildInfo.scala
Supertypes
class Object
trait Matchable
class Any
Self type
BuildInfo.type
sealed trait CanCast[From, To]

Attributes

Companion
object
Source
CanCast.scala
Supertypes
class Object
trait Matchable
class Any
object CanCast

Attributes

Companion
trait
Source
CanCast.scala
Supertypes
class Object
trait Matchable
class Any
Self type
CanCast.type
sealed trait CanTryCast[From, To]

Attributes

Companion
object
Source
CanTryCast.scala
Supertypes
class Object
trait Matchable
class Any
object CanTryCast

Attributes

Companion
trait
Source
CanTryCast.scala
Supertypes
class Object
trait Matchable
class Any
Self type
CanTryCast.type
sealed trait Codec[T]

Attributes

Companion
object
Source
Codec.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait EnumAsString[T]
class Product[T]
object Codec

Attributes

Companion
trait
Source
Codec.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Codec.type
sealed trait Comparable[T] extends Serializable

Type class that serves as evidence that a type can be compared in the Expr API.

Type class that serves as evidence that a type can be compared in the Expr API.

For opaque types backed that should be comparable one just needs to provide the a given instance for the Comparable type.

opaque type MyLong = Long
object MyLong {
 given Comparable[MyLong] = Comparable[Long]
}

Attributes

Companion
object
Source
Comparable.scala
Supertypes
trait Serializable
class Object
trait Matchable
class Any
Known subtypes
trait Primitive[T]
object Comparable

Attributes

Companion
trait
Source
Comparable.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Comparable.type

Attributes

Source
CompiledExplodeExpr.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed trait Dataset[T]

Attributes

Companion
object
Source
Dataset.scala
Supertypes
class Object
trait Matchable
class Any
object Dataset

Attributes

Companion
trait
Source
Dataset.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Dataset.type
object Date

Attributes

Source
Date.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Date.type
object Decimal

Attributes

Source
Decimal.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Decimal.type
trait Defaults[T]

Type class that extracts default values from field definitions of a case class.

Type class that extracts default values from field definitions of a case class.

The default values are obtained using macros by looking for generated methods of the companion object of the case class. This seems to be the only way to obtain default values for case class fields in Scala 3. And is how it is done in other libraries like circe [0], magnolia [1]. Hopefully, this can be replace by some builin support in the future [3].

[0] https://github.com/circe/circe/blob/400433e44cf8821caec34568e7f9e1384febf329/modules/core/shared/src/main/scala-3/io/circe/derivation/Default.scala#L73

[1] https://github.com/softwaremill/magnolia/blob/08c224f4a55904bc94060f9bcf7fac0940e2949e/core/src/main/scala/magnolia1/macro.scala#L73

[3] https://github.com/scala/scala3/discussions/17893

Attributes

Companion
object
Source
Defaults.scala
Supertypes
class Object
trait Matchable
class Any
object Defaults

Attributes

Companion
trait
Source
Defaults.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Defaults.type
object Duration

Attributes

Source
Duration.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Duration.type
final case class ExplodeExpr[T](asNode: Explode[T])

Attributes

Source
ExplodeExpr.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final class Expr[T] extends Selectable

A typed expression using in the Dataset API.

A typed expression using in the Dataset API.

This leverages NamedTuple to provide type safe access to fields when T is a product type.

Attributes

Companion
object
Source
Expr.scala
Supertypes
trait Selectable
class Object
trait Matchable
class Any
object Expr extends ExprApi[Expr]

Attributes

Companion
class
Source
Expr.scala
Supertypes
trait ExprApi[Expr]
class Object
trait Matchable
class Any
Self type
Expr.type
trait ExprApi[Expr[T]]

Contains the public api for a Expr[T] the api is provided as extension methods.

Contains the public api for a Expr[T] the api is provided as extension methods.

It is implemented as a trait taking a type parameter Expr[_] so that it can be reused for both Expr[_] and AggregateExpr[_] without duplicating the code.

Attributes

Source
ExprApi.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object AggregateExpr
object Expr
final case class FileMetadata(file_path: String)

Spark and other query engines often support access to metadata like path, modified time, and file sizes.

Spark and other query engines often support access to metadata like path, modified time, and file sizes.

This adds this information in a typed class. Currently, only the path is provided as that is all that is currently needed.

Note: This class is created using untyped apis in each tyda backend. Therefore, each backend must be updated when extending this class.

Attributes

Source
FileMetadata.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
enum Format

Attributes

Source
Format.scala
Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
trait Groupable[T] extends Serializable

Type class that service as evidence that a type can be used in grouping operations.

Type class that service as evidence that a type can be used in grouping operations.

This is all types except for Map and types that contain Map.

Attributes

Companion
object
Source
Groupable.scala
Supertypes
trait Serializable
class Object
trait Matchable
class Any
object Groupable

Attributes

Companion
trait
Source
Groupable.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Groupable.type
sealed trait GroupedDataset[N <: Tuple, KV <: Tuple, V](using evidence$1: Codec[V], x$1: Codec[NamedTuple[N, KV]])

Attributes

Companion
object
Source
GroupedDataset.scala
Supertypes
class Object
trait Matchable
class Any

Attributes

Companion
trait
Source
GroupedDataset.scala
Supertypes
class Object
trait Matchable
class Any
Self type

Type class used to retrict ExprApi.toJson and ExprApi.fromJson to only support structs and arrays.

Type class used to retrict ExprApi.toJson and ExprApi.fromJson to only support structs and arrays.

This is mainly to make the intial support easier to implement and will hopefully be lifted in the future.

Attributes

Companion
object
Source
JsonArrayOrObject.scala
Supertypes
trait Serializable
class Object
trait Matchable
class Any

Attributes

Companion
trait
Source
JsonArrayOrObject.scala
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Source
Ord.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Ord
sealed trait Merger[Left, Right]

Type class for merging two product types Left and Right into a new product type Out.

Type class for merging two product types Left and Right into a new product type Out.

When merging, if there are fields with the same name in both Left and Right, the field from Right have precedence and will be used in the resulting type Out.

For example: TODO: Remove nocompile when https://github.com/scala/scala3/issues/24946 is fixed

case class A(x: Int, y: String)
case class B(y: Int, z: Boolean)
val merger = Merger[A, B]
val m: (x: Int, y: Int, z: Boolean) = merger(A(1, "hello"), B(2, true))
// (x = 1, y = 2, z = true)

This is similar to record merge in shapeless2.

Note: This could be implemented using match types instead, but we did not find a way to make that without significant compiletime cost for large products.

Attributes

Companion
object
Source
Merger.scala
Supertypes
class Object
trait Matchable
class Any
object Merger

Attributes

Companion
trait
Source
Merger.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Merger.type

Attributes

Companion
object
Source
NumericsReadMode.scala
Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
enum
Source
NumericsReadMode.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
trait Ord[T] extends Ordering[T]

Ord is an SQL compatible Ordering that allows automatic derivation for sum and product types.

Ord is an SQL compatible Ordering that allows automatic derivation for sum and product types.

It is intended to be used in the derives clause for case classes and enums that should have orderings.

The implementation is intended to be compatible with ordering used in common SQL engines like Spark. This means that the ordering for floating point is the one commonly used in sql engines where -0.0 == 0.0 and NaN is larger than all values.

For example in Spark:

scala> spark.sql("SELECT -0.0 == 0.0, -0.0 < 0.0").show()
+-----------+-----------+
|(0.0 = 0.0)|(0.0 < 0.0)|
+-----------+-----------+
|       true|      false|
+-----------+-----------+

or duckdb

duckdb> SELECT -0.0 == 0.0, -0.0 < 0.0;
┌─────────────┬─────────────┐
│ (0.0 = 0.0) ┆ (0.0 < 0.0) │
╞═════════════╪═════════════╡
│        true ┆       false │
└─────────────┴─────────────┘

or postgres

postgres=# SELECT -0.0 = 0.0, -0.0 < 0.0;
?column? | ?column?
----------+----------
t        | f
(1 row)

Sadly GoogleSQL used in BigQuery does not support this and instead have IEEE semantics.

Attributes

Companion
object
Source
Ord.scala
Supertypes
trait Ordering[T]
trait PartialOrdering[T]
trait Equiv[T]
trait Serializable
trait Comparator[T]
class Object
trait Matchable
class Any
Show all
Known subtypes
object double
object float
object Ord extends LowPriorityOrd

Attributes

Companion
trait
Source
Ord.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Ord.type
trait Orderable[T] extends Serializable

Type class that serves as evidence that a type can be used in ordering operations.

Type class that serves as evidence that a type can be used in ordering operations.

All primitive types are orderable. Option, products, and sum types are orderable if their element types are orderable. Seq and Map types are not orderable, reflecting the fact that SQL engines (e.g. BigQuery) do not support ORDER BY on array or map columns.

Attributes

Companion
object
Source
Orderable.scala
Supertypes
trait Serializable
class Object
trait Matchable
class Any
object Orderable

Attributes

Companion
trait
Source
Orderable.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Orderable.type
sealed trait Projector[Source, Target]

Attributes

Companion
object
Source
Projector.scala
Supertypes
class Object
trait Matchable
class Any
object Projector

Attributes

Companion
trait
Source
Projector.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Projector.type
object ReferenceId

Attributes

Source
ReferenceId.scala
Supertypes
class Object
trait Matchable
class Any
Self type
sealed trait Remover[T, E]

Type class for removing unique field of type E from a product type P.

Type class for removing unique field of type E from a product type P.

This is inspired by the Remove[1] in shapeless2 but defined for any type P which has a Mirror.ProductOf instance and a unique field of type E.

[1] https://github.com/milessabin/shapeless/blob/de11db9ff9e26ea60dced5c6a745ad2a56f9f724/core/shared/src/main/scala/shapeless/ops/records.scala#L433-L439

Attributes

Companion
object
Source
Remover.scala
Supertypes
class Object
trait Matchable
class Any
object Remover

Attributes

Companion
trait
Source
Remover.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Remover.type
trait Runner

Attributes

Source
Runner.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
enum RunnerArgs

Attributes

Companion
object
Source
RunnerArgs.scala
Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object RunnerArgs

Attributes

Companion
enum
Source
RunnerArgs.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
RunnerArgs.type
sealed trait Selector[P, E]

Type class for extracting unique field of type E from the product type P.

Type class for extracting unique field of type E from the product type P.

This inspired by the Selector in shapeless2 but defined for any type P which has a Mirror.ProductOf instance and a unique field of type E.

Attributes

Companion
object
Source
Selector.scala
Supertypes
class Object
trait Matchable
class Any
object Selector

Attributes

Companion
trait
Source
Selector.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Selector.type

Attributes

Source
SimpleTypeName.scala
Supertypes
class Object
trait Matchable
class Any
Self type
object Singletons

Attributes

Source
Singletons.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Singletons.type

Attributes

Source
StringLiterals.scala
Supertypes
class Object
trait Matchable
class Any
Self type
sealed trait SumMagnet[T] extends Serializable

Attributes

Companion
object
Source
SumMagnet.scala
Supertypes
trait Serializable
class Object
trait Matchable
class Any
object SumMagnet

Attributes

Companion
trait
Source
SumMagnet.scala
Supertypes
class Object
trait Matchable
class Any
Self type
SumMagnet.type

Attributes

Source
TableLocation.scala
Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Timestamp

Attributes

Source
Timestamp.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Timestamp.type

Attributes

Source
TupleOperations.scala
Supertypes
class Object
trait Matchable
class Any
Self type
final case class TypeName[T](value: String)

Attributes

Companion
object
Source
TypeName.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object TypeName

Attributes

Companion
class
Source
TypeName.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
TypeName.type
object UniqueIndexOf

Attributes

Source
UniqueIndexOf.scala
Supertypes
class Object
trait Matchable
class Any
Self type
object Variant

Attributes

Source
Codec.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Variant.type
object aggregates

Attributes

Source
aggregates.scala
Supertypes
class Object
trait Matchable
class Any
Self type
aggregates.type

Deprecated classlikes

Mixin that provides a stable hashCode for Enums.

Mixin that provides a stable hashCode for Enums.

Singletons case for enums do not have stable hashCode (at least as of Scala 3.7.0 but according to https://github.com/scala/scala3/issues/19177 will in the future). This is a problem when an enum is used in a RDD that get partitioned using the HashPartitioner. When it been fixed upstream, this mixin can be removed.

Note: That stable here only promises that the hashCode is stable across jvm executions but the implementation might be changed in the future.

Attributes

Deprecated
No longer needed since Scala 3.7.3
Source
EnumStableHashCode.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Enum

Types

opaque type AllSingletons[T]

A type class that provides access and serves as evidence that all values of a enum are singletons.

A type class that provides access and serves as evidence that all values of a enum are singletons.

Attributes

Source
AllSingletons.scala
opaque type Arity[T]

Attributes

Source
Arity.scala
opaque type Binary

An immutable sequence of bytes with value semantics.

An immutable sequence of bytes with value semantics.

In SQL backends this corresponds to the BINARY / BYTES type.

Attributes

Source
Binary.scala
opaque type Date

Date represents a calendar date.

Date represents a calendar date.

Valid range is [0001-01-01, 9999-12-31]. Values outside this range will cause an java.lang.ArithmeticException when constructed via Date.fromDays or arithmetic operations. Note that this limit is not always strictly enforced when reading data from external sources such as Parquet files.

Attributes

Source
Date.scala
opaque type Decimal[Precision <: Int, Scale <: Int]

Decimal type with compile-time precision and scale.

Decimal type with compile-time precision and scale.

This type is constrained to be encodable as a 128 bit value. This means that the maximum precision is 38 and the scale is less or equal to the precision. This mostly matches how Spark handles decimal types.

Attributes

Source
Decimal.scala
opaque type Duration

Represents a duration of time with microsecond precision.

Represents a duration of time with microsecond precision.

In SQL the corresponding type is INTERVAL DAY TO SECOND.

Attributes

Source
Duration.scala
opaque type ReferenceId

Attributes

Source
ReferenceId.scala
opaque type SimpleTypeName[T]

Typeclass that produces the simple (unqualified) typename with type parameters.

Typeclass that produces the simple (unqualified) typename with type parameters.

Attributes

Source
SimpleTypeName.scala
opaque type Singletons[T]

A type class that provides access to the singletons values of an enum.

A type class that provides access to the singletons values of an enum.

If you want to ensure that all values of an enum are singletons, use AllSingletons instead.

Attributes

Source
Singletons.scala
opaque type StringLiterals[T <: Tuple]

The collection of strings of a tuple of string literals.

The collection of strings of a tuple of string literals.

Attributes

Source
StringLiterals.scala
opaque type Timestamp

A timestamp represents a point in time with microsecond precision.

A timestamp represents a point in time with microsecond precision.

Valid range is [0001-01-01T00:00:00.000000Z, 9999-12-31T23:59:59.999999Z]. Values outside this range will cause an java.lang.ArithmeticException when constructed via Timestamp.fromMicros . Note that this limit is not always strictly enforced when reading data from external sources such as Parquet files.

NOTE: In practice it's implemented as a Long representing the number of microseconds since the unix epoch. But this should not be exposed at api level Expr[Timestamp] might have a different implmentation in some backends.

Attributes

Source
Timestamp.scala
opaque type UniqueIndexOf[T <: Tuple, E]

Given that provides the index of the unique occurrence of the type E in the tuple T.

Given that provides the index of the unique occurrence of the type E in the tuple T.

If there is no ocurrence or multiple occurences no given is provided.

Attributes

Source
UniqueIndexOf.scala

Value members

Concrete fields

val functions: Expr.type

Attributes

Source
functions.scala

Extensions

Extensions

extension [T](p: T)(using m: ProductOf[T])
inline def asProduct: Product

Cast T to Product.

Cast T to Product.

The current understanding that the Mirror.ProductOf[T] guarantees that the cast is safe.

Attributes

Source
utils.scala