// TODO[BEAM-9179] Add conversion code for ARRAY and ROW types
public static SqlTypeName zetaSqlTypeToCalciteType(TypeKind zetaSqlType) {
    switch (zetaSqlType) {
      case TYPE_INT64:
        return SqlTypeName.BIGINT;
      case TYPE_NUMERIC:
        return SqlTypeName.DECIMAL;
      case TYPE_DOUBLE:
        return SqlTypeName.DOUBLE;
      case TYPE_STRING:
        return SqlTypeName.VARCHAR;
      case TYPE_TIMESTAMP:
        return SqlTypeName.TIMESTAMP;
      case TYPE_BOOL:
        return SqlTypeName.BOOLEAN;
      case TYPE_BYTES:
        return SqlTypeName.VARBINARY;
        // TODO[BEAM-9179] Add conversion code for ARRAY and ROW types
      default:
        throw new IllegalArgumentException("Unsupported ZetaSQL type: " + zetaSqlType.name());
    }
  }
case TYPE_BYTES:
return SqlTypeName.VARBINARY;
// TODO[BEAM-9179] Add conversion code for ARRAY and ROW types
default:
throw new IllegalArgumentException("Unsupported ZetaSQL type: " + zetaSqlType.name());
case TYPE_DOUBLE:
return SqlTypeName.DOUBLE;
case TYPE_STRING:
return SqlTypeName.VARCHAR;
case TYPE_TIMESTAMP:
return SqlTypeName.TIMESTAMP;
case TYPE_BOOL:
return SqlTypeName.BOOLEAN;
case TYPE_BYTES:
return SqlTypeName.VARBINARY;
// TODO[BEAM-9179] Add conversion code for ARRAY and ROW types
default:
throw new IllegalArgumentException("Unsupported ZetaSQL type: " + zetaSqlType.name());
}
}
public static SqlTypeName zetaSqlTypeToCalciteType(TypeKind zetaSqlType) {
switch (zetaSqlType) {
case TYPE_INT64:
return SqlTypeName.BIGINT;
case TYPE_NUMERIC:
return SqlTypeName.DECIMAL;
case TYPE_DOUBLE:
return SqlTypeName.DOUBLE;
case TYPE_STRING:
return SqlTypeName.VARCHAR;
case TYPE_TIMESTAMP:
return SqlTypeName.TIMESTAMP;
case TYPE_BOOL:
return SqlTypeName.BOOLEAN;
case TYPE_BYTES:
return SqlTypeName.VARBINARY;
// TODO[BEAM-9179] Add conversion code for ARRAY and ROW types
default:
throw new IllegalArgumentException("Unsupported ZetaSQL type: " + zetaSqlType.name());
}
}