All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.audienceproject.crossbow.schema.Column.scala Maven / Gradle / Ivy

package com.audienceproject.crossbow.schema

import com.audienceproject.crossbow.expr.{AnyType, Type, Types, ru}

case class Column private[crossbow](name: String, columnType: Type) {

  def renamed(newName: String): Column = Column(newName, columnType)

  override def toString: String = s"$name: $columnType"

}

object Column {

  def apply[T: ru.TypeTag](columnName: String): Column =
    Column(columnName, Types.toInternalType(ru.typeOf[T]))

  def unspecialized[T: ru.TypeTag](columnName: String): Column =
    Column(columnName, AnyType(ru.typeOf[T]))

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy