Skip to content

Commit

Permalink
Fixed naming
Browse files Browse the repository at this point in the history
  • Loading branch information
pravinbhat committed Oct 18, 2024
1 parent 6ee6434 commit b5ddaec
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/datastax/cdm/feature/WritetimeTTL.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public boolean loadProperties(IPropertyHelper propertyHelper) {
logger.info("PARAM -- WriteTimestampCols: {}", writetimeNames);
this.autoWritetimeNames = false;
}
allowCollectionsForWritetimeTTL = propertyHelper.getBoolean(KnownProperties.ALLOW_COLL_FOR_WRITETIME_TTL_COLS);
allowCollectionsForWritetimeTTL = propertyHelper.getBoolean(KnownProperties.ALLOW_COLL_FOR_WRITETIME_TTL_CALC);
this.customWritetime = getCustomWritetime(propertyHelper);
if (this.customWritetime > 0) {
logger.info("PARAM -- {}: {} datetime is {} ", KnownProperties.TRANSFORM_CUSTOM_WRITETIME, customWritetime,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public enum PropertyType {
public static final String ORIGIN_TTL_NAMES = "spark.cdm.schema.origin.column.ttl.names";
public static final String ORIGIN_WRITETIME_AUTO = "spark.cdm.schema.origin.column.writetime.automatic";
public static final String ORIGIN_WRITETIME_NAMES = "spark.cdm.schema.origin.column.writetime.names";
public static final String ALLOW_COLL_FOR_WRITETIME_TTL_COLS = "spark.cdm.schema.origin.column.ttlwritetime.allow.collections";
public static final String ALLOW_COLL_FOR_WRITETIME_TTL_CALC = "spark.cdm.schema.ttlwritetime.calc.useCollections";

public static final String ORIGIN_COLUMN_NAMES_TO_TARGET = "spark.cdm.schema.origin.column.names.to.target";

Expand All @@ -91,8 +91,8 @@ public enum PropertyType {
types.put(ORIGIN_WRITETIME_NAMES, PropertyType.STRING_LIST);
types.put(ORIGIN_WRITETIME_AUTO, PropertyType.BOOLEAN);
defaults.put(ORIGIN_WRITETIME_AUTO, "true");
types.put(ALLOW_COLL_FOR_WRITETIME_TTL_COLS, PropertyType.BOOLEAN);
defaults.put(ALLOW_COLL_FOR_WRITETIME_TTL_COLS, "false");
types.put(ALLOW_COLL_FOR_WRITETIME_TTL_CALC, PropertyType.BOOLEAN);
defaults.put(ALLOW_COLL_FOR_WRITETIME_TTL_CALC, "false");
types.put(ORIGIN_COLUMN_NAMES_TO_TARGET, PropertyType.STRING_LIST);
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/datastax/cdm/schema/CqlTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ private void setCqlMetadata(CqlSession cqlSession) {
.collect(Collectors.toCollection(() -> this.cqlAllColumns));

boolean allowCollectionsForWritetimeTTL = propertyHelper
.getBoolean(KnownProperties.ALLOW_COLL_FOR_WRITETIME_TTL_COLS);
.getBoolean(KnownProperties.ALLOW_COLL_FOR_WRITETIME_TTL_CALC);
this.writetimeTTLColumns = tableMetadata.getColumns().values().stream()
.filter(columnMetadata -> canColumnHaveTTLorWritetime(tableMetadata, columnMetadata,
allowCollectionsForWritetimeTTL))
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/com/datastax/cdm/feature/WritetimeTTLTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ public void getLargestWriteTimeStampTest() {

@Test
public void getLargestWriteTimeStampWithListTest() {
when(propertyHelper.getBoolean(KnownProperties.ALLOW_COLL_FOR_WRITETIME_TTL_COLS)).thenReturn(true);
when(propertyHelper.getBoolean(KnownProperties.ALLOW_COLL_FOR_WRITETIME_TTL_CALC)).thenReturn(true);
when(propertyHelper.getLong(KnownProperties.TRANSFORM_CUSTOM_WRITETIME)).thenReturn(0L);
when(originTable.indexOf("WRITETIME("+writetimeColumnName+")")).thenReturn(100);
when(originRow.getType(eq(100))).thenReturn(DataTypes.listOf(DataTypes.BIGINT));
Expand Down Expand Up @@ -412,7 +412,7 @@ public void getLargestTTLTest() {

@Test
public void getLargestTTLWithListTest() {
when(propertyHelper.getBoolean(KnownProperties.ALLOW_COLL_FOR_WRITETIME_TTL_COLS)).thenReturn(true);
when(propertyHelper.getBoolean(KnownProperties.ALLOW_COLL_FOR_WRITETIME_TTL_CALC)).thenReturn(true);
when(propertyHelper.getLong(KnownProperties.TRANSFORM_CUSTOM_TTL)).thenReturn(null);
when(originTable.indexOf("TTL("+ttlColumnName+")")).thenReturn(100);
when(originRow.getType(eq(100))).thenReturn(DataTypes.listOf(DataTypes.INT));
Expand Down

0 comments on commit b5ddaec

Please sign in to comment.