Kotlin / dataframe

Structured data processing in Kotlin
https://kotlin.github.io/dataframe/overview.html
Apache License 2.0
818 stars 58 forks source link

Trino Support #850

Open PaulWoitaschek opened 1 month ago

PaulWoitaschek commented 1 month ago

We're using Trino (previously called Presto) and it would be great to have first party support for Trino in dataframe.

With this little hack (delegating it to Postgre) it's already working for us but this is probably not a solution for all cases:

object Trino : DbType("trino") {

  override val driverClassName: String = "io.trino.jdbc.TrinoDriver"

  override fun buildTableMetadata(tables: ResultSet): TableMetadata = PostgreSql.buildTableMetadata(tables)

  override fun convertSqlTypeToColumnSchemaValue(tableColumnMetadata: TableColumnMetadata): ColumnSchema? =
    PostgreSql.convertSqlTypeToColumnSchemaValue(tableColumnMetadata)

  override fun convertSqlTypeToKType(tableColumnMetadata: TableColumnMetadata): KType? =
    PostgreSql.convertSqlTypeToKType(tableColumnMetadata)

  override fun isSystemTable(tableMetadata: TableMetadata): Boolean = PostgreSql.isSystemTable(tableMetadata)
}
zaleslaw commented 4 weeks ago

Dear @PaulWoitaschek thanks for suggestions, we have a blocker in our plugins (symbol-processor) and could not provide for now free registration for any SQL sources, but I believe it will be a goal for next release, because it's a high demand there.

When we will finish the system redesign, we will provide a simple how-to in the spirit of your code snippet