You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by "bereng (via GitHub)" <gi...@apache.org> on 2023/04/03 07:39:45 UTC
[GitHub] [cassandra] bereng commented on a diff in pull request #2236: CASSANDRA-18037 trunk: Use snake case for the names CQL native functions
bereng commented on code in PR #2236:
URL: https://github.com/apache/cassandra/pull/2236#discussion_r1155588099
##########
src/java/org/apache/cassandra/cql3/functions/CastFcts.java:
##########
@@ -126,25 +130,38 @@ private static <I extends Number> java.util.function.Function<I, BigDecimal> get
}
/**
- * Creates the name of the cast function use to cast to the specified type.
+ * Creates the snake-cased name of the cast function used to cast to the specified type.
*
* @param outputType the output type
- * @return the name of the cast function use to cast to the specified type
+ * @return the name of the cast function used to cast to the specified type
*/
- public static String getFunctionName(AbstractType<?> outputType)
+ public static String getFunctionName(CQL3Type outputType)
{
- return getFunctionName(outputType.asCQL3Type());
+ return FUNCTION_NAME_PREFIX + toLowerCaseString(outputType);
}
/**
- * Creates the name of the cast function use to cast to the specified type.
+ * Creates the legacy camel-cased name of the cast function used to cast to the specified type.
*
* @param outputType the output type
- * @return the name of the cast function use to cast to the specified type
+ * @return the legacy camel-cased name of the cast function used to cast to the specified type
*/
- public static String getFunctionName(CQL3Type outputType)
+ private static String getLegacyFunctionName(CQL3Type outputType)
+ {
+ return LEGACY_FUNCTION_NAME_PREFIX + WordUtils.capitalize(toLowerCaseString(outputType));
Review Comment:
Will `WordUtils.capitalize()` ever kick in? It's going to be fed the lowercase class name, iiuc, which will never have blank spaces
--
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: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org