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

com.crobox.clickhouse.dsl.language.NullableFunctionTokenizer.scala Maven / Gradle / Ivy

There is a newer version: 1.2.5
Show newest version
package com.crobox.clickhouse.dsl.language

import com.crobox.clickhouse.dsl._

trait NullableFunctionTokenizer {
  self: ClickhouseTokenizerModule =>

  protected def tokenizeNullableFunction(col: NullableFunction)(implicit ctx: TokenizeContext): String =
    col match {
      case IsNull(c)        => s"isNull(${tokenizeColumn(c.column)})"
      case IsNullable(c)    => s"isNullable(${tokenizeColumn(c.column)})"
      case IsNotNull(c)     => s"isNotNull(${tokenizeColumn(c.column)})"
      case IsZeroOrNull(c)  => s"isZeroOrNull(${tokenizeColumn(c.column)})"
      case AssumeNotNull(c) => s"assumeNotNull(${tokenizeColumn(c.column)})"
      case ToNullable(c)    => s"toNullable(${tokenizeColumn(c.column)})"
      case IfNull(c, alt)   => s"ifNull(${tokenizeColumn(c.column)}, ${tokenizeColumn(alt.column)})"
      case NullIf(c, o)     => s"nullIf(${tokenizeColumn(c.column)}, ${tokenizeColumn(o.column)})"
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy