Skip to content

Commit

Permalink
added clob as string alias
Browse files Browse the repository at this point in the history
  • Loading branch information
KushnirykOleh committed Jul 30, 2024
1 parent 906c6e7 commit e4b37ba
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class DatabricksDatabase extends AbstractJdbcDatabase {
private Set<String> systemTablesAndViews = new HashSet<>();

//Define data type names enabled for auto-increment columns - currently only BIGINT
public static final List<String> VALID_AUTO_INCREMENT_COLUMN_TYPE_NAMES = Collections.unmodifiableList(Arrays.asList("BIGINT"));
public static final List<String> VALID_AUTO_INCREMENT_COLUMN_TYPE_NAMES = Collections.singletonList("BIGINT");

public DatabricksDatabase() {
super.setCurrentDateTimeFunction("current_timestamp()");
Expand Down Expand Up @@ -133,6 +133,11 @@ public boolean supportsTablespaces() {
@Override
public boolean supportsSequences() { return false; }

@Override
public boolean supportsDatabaseChangeLogHistory() {
return true;
}

@Override
public String getAutoIncrementClause(final BigInteger startWith, final BigInteger incrementBy, final String generationType, final Boolean defaultOnNull) {
if (!this.supportsAutoIncrement()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,25 @@
import liquibase.database.Database;
import liquibase.datatype.DataTypeInfo;
import liquibase.datatype.DatabaseDataType;
import liquibase.datatype.LiquibaseDataType;
import liquibase.datatype.core.VarcharType;
import liquibase.ext.databricks.database.DatabricksDatabase;

@DataTypeInfo(
name = "string",
minParameters = 0,
maxParameters = 0,
priority = DatabricksDatabase.DATABRICKS_PRIORITY_DATABASE
priority = DatabricksDatabase.DATABRICKS_PRIORITY_DATABASE,
aliases = { "varchar", "clob", "java.lang.String" }
)
public class StringDatatypeDatabricks extends LiquibaseDataType {
public class StringDatatypeDatabricks extends VarcharType {
public StringDatatypeDatabricks() {
}

@Override
public boolean supports(Database database) {
return database instanceof DatabricksDatabase;
}

@Override
public DatabaseDataType toDatabaseDataType(Database database) {
if (database instanceof DatabricksDatabase) {

Expand Down

0 comments on commit e4b37ba

Please sign in to comment.