skoppu22 commented on code in PR #172:
URL:
https://github.com/apache/cassandra-analytics/pull/172#discussion_r2813513233
##########
cassandra-analytics-core/src/main/java/org/apache/cassandra/spark/bulkwriter/BulkSparkConf.java:
##########
@@ -364,6 +367,43 @@ protected void validateEnvironment() throws
RuntimeException
validateSslConfiguration();
}
+ protected void validateUserAddedColumns(String ttlColName, String
timestampColName)
+ {
+ if (this.quoteIdentifiers)
+ {
+ return;
+ }
+
+ Preconditions.checkArgument(doesNotHaveUpperCaseChars(ttlColName),
+
columnValidationErrMsg(WriterOptions.TTL.name()));
+
Preconditions.checkArgument(doesNotHaveUpperCaseChars(timestampColName),
+
columnValidationErrMsg(WriterOptions.TIMESTAMP.name()));
+ }
+
+ private String columnValidationErrMsg(String option)
+ {
+ return String.format("Prefer setting lowercase chars for %s option. If
uppercase is required, set %s to " +
+ "true. Note %s option will be applied for all
column names", option,
+ WriterOptions.QUOTE_IDENTIFIERS.name(),
WriterOptions.QUOTE_IDENTIFIERS.name());
+ }
+
+ private boolean doesNotHaveUpperCaseChars(String name)
Review Comment:
Not sure is there a existing Java utility function to o this check. Java
experts may comment here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]