[
https://issues.apache.org/jira/browse/PHOENIX-5654?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17005490#comment-17005490
]
Nitesh Maheshwari commented on PHOENIX-5654:
--------------------------------------------
Another case that needs to be handled is invalid string values for
update_cache_frequency, both as part of the create table DDL and for
connection-level property. We currently raise a rather less meaningful error
message for invalid string values when specified as part of the create table
DDL:
{code:java}
0: jdbc:phoenix:localhost:63466> create table t1 (a integer primary key)
update_cache_frequency=blah;
java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Long
at
org.apache.phoenix.schema.MetaDataClient.createTable(MetaDataClient.java:1016)
at
org.apache.phoenix.compile.CreateTableCompiler$1.execute(CreateTableCompiler.java:216)
at
org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:411)
at
org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:394)
at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
at
org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:393)
at
org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:381)
at
org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:1843)
at sqlline.Commands.execute(Commands.java:971)
at sqlline.Commands.sql(Commands.java:906)
at sqlline.SqlLine.dispatch(SqlLine.java:740)
at sqlline.SqlLine.begin(SqlLine.java:557)
at sqlline.SqlLine.start(SqlLine.java:270)
at sqlline.SqlLine.main(SqlLine.java:201)
{code}
> String values (ALWAYS and NEVER) don't work for connection level config
> phoenix.default.update.cache.frequency
> --------------------------------------------------------------------------------------------------------------
>
> Key: PHOENIX-5654
> URL: https://issues.apache.org/jira/browse/PHOENIX-5654
> Project: Phoenix
> Issue Type: Bug
> Affects Versions: 4.15.0
> Reporter: Nitesh Maheshwari
> Assignee: Nitesh Maheshwari
> Priority: Major
> Fix For: 4.15.1
>
>
> While working on PHOENIX-5634, I noticed that the connection level property
> 'phoenix.default.update.cache.frequency' is being read in
> 'MetadataClient::createTable()' and 'Metadata::createTableInternal()' as
> follows:
> {code:java}
> long updateCacheFrequency = connection.getQueryServices().getProps().getLong(
> QueryServices.DEFAULT_UPDATE_CACHE_FREQUENCY_ATRRIB,
> QueryServicesOptions.DEFAULT_UPDATE_CACHE_FREQUENCY);
> {code}
> However, looking at the documentation for option 'UPDATE_CACHE_FREQUENCY' atÂ
> [https://phoenix.apache.org/language/index.html], the value for this config
> could also be set to strings 'ALWAYS' and 'NEVER'. The use of getLong() above
> will always return 'QueryServicesOptions.DEFAULT_UPDATE_CACHE_FREQUENCY' when
> the config is set to 'ALWAYS'/'NEVER'. Reading the connection-level property
> should also follow the way the table-level property is read in
> 'TableProperty.UPDATE_CACHE_FREQUENCY'.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)