Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keyspace system_views related table not able to select with cassandra-lucene-index-plugin-4.1.0-1.0.0.jar #16

Open
Sreemanth opened this issue Jun 1, 2023 · 3 comments

Comments

@Sreemanth
Copy link

CQL Query

 select * from system_views.settings;

Error in CQL

NoHostAvailable: ('Unable to complete the operation against any hosts', {<Host: 127.0.0.1:9042 datacenter1>: <Error from server: code=0000 [Server error] message="java.lang.IllegalStateException: Cannot initialize Keyspace with virtual metadata system_views">})

Error in system.log file

ERROR [Native-Transport-Requests-1] 2023-06-01 15:55:28,514 QueryMessage.java:129 - Unexpected error during query
java.lang.IllegalStateException: Cannot initialize Keyspace with virtual metadata system_views
	at org.apache.cassandra.db.Keyspace.<init>(Keyspace.java:342)
	at org.apache.cassandra.db.Keyspace.lambda$open$0(Keyspace.java:163)
	at org.apache.cassandra.utils.concurrent.LoadingMap.blockingLoadIfAbsent(LoadingMap.java:105)
	at org.apache.cassandra.schema.Schema.maybeAddKeyspaceInstance(Schema.java:230)
	at org.apache.cassandra.db.Keyspace.open(Keyspace.java:163)
	at org.apache.cassandra.db.Keyspace.open(Keyspace.java:152)
	at com.stratio.cassandra.lucene.IndexQueryHandler.luceneExpressions(IndexQueryHandler.scala:129)
	at com.stratio.cassandra.lucene.IndexQueryHandler.processStatement(IndexQueryHandler.scala:103)
	at com.stratio.cassandra.lucene.IndexQueryHandler.process(IndexQueryHandler.scala:91)
	at org.apache.cassandra.transport.messages.QueryMessage.execute(QueryMessage.java:116)
	at org.apache.cassandra.transport.Message$Request.execute(Message.java:254)
	at org.apache.cassandra.transport.Dispatcher.processRequest(Dispatcher.java:122)
	at org.apache.cassandra.transport.Dispatcher.processRequest(Dispatcher.java:141)
	at org.apache.cassandra.transport.Dispatcher.processRequest(Dispatcher.java:168)
	at org.apache.cassandra.transport.Dispatcher.lambda$dispatch$0(Dispatcher.java:82)
	at org.apache.cassandra.concurrent.FutureTask$1.call(FutureTask.java:81)
	at org.apache.cassandra.concurrent.FutureTask.call(FutureTask.java:47)
	at org.apache.cassandra.concurrent.FutureTask.run(FutureTask.java:57)
	at org.apache.cassandra.concurrent.SEPWorker.run(SEPWorker.java:120)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:829)
ERROR [Native-Transport-Requests-1] 2023-06-01 15:55:28,515 ErrorMessage.java:457 - Unexpected exception during request
java.lang.IllegalStateException: Cannot initialize Keyspace with virtual metadata system_views
	at org.apache.cassandra.db.Keyspace.<init>(Keyspace.java:342)
	at org.apache.cassandra.db.Keyspace.lambda$open$0(Keyspace.java:163)
	at org.apache.cassandra.utils.concurrent.LoadingMap.blockingLoadIfAbsent(LoadingMap.java:105)
	at org.apache.cassandra.schema.Schema.maybeAddKeyspaceInstance(Schema.java:230)
	at org.apache.cassandra.db.Keyspace.open(Keyspace.java:163)
	at org.apache.cassandra.db.Keyspace.open(Keyspace.java:152)
	at com.stratio.cassandra.lucene.IndexQueryHandler.luceneExpressions(IndexQueryHandler.scala:129)
	at com.stratio.cassandra.lucene.IndexQueryHandler.processStatement(IndexQueryHandler.scala:103)
	at com.stratio.cassandra.lucene.IndexQueryHandler.process(IndexQueryHandler.scala:91)
	at org.apache.cassandra.transport.messages.QueryMessage.execute(QueryMessage.java:116)
	at org.apache.cassandra.transport.Message$Request.execute(Message.java:254)
	at org.apache.cassandra.transport.Dispatcher.processRequest(Dispatcher.java:122)
	at org.apache.cassandra.transport.Dispatcher.processRequest(Dispatcher.java:141)
	at org.apache.cassandra.transport.Dispatcher.processRequest(Dispatcher.java:168)
	at org.apache.cassandra.transport.Dispatcher.lambda$dispatch$0(Dispatcher.java:82)
	at org.apache.cassandra.concurrent.FutureTask$1.call(FutureTask.java:81)
	at org.apache.cassandra.concurrent.FutureTask.call(FutureTask.java:47)
	at org.apache.cassandra.concurrent.FutureTask.run(FutureTask.java:57)
	at org.apache.cassandra.concurrent.SEPWorker.run(SEPWorker.java:120)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:829)
@smiklosovic
Copy link
Collaborator

smiklosovic commented Jun 19, 2023

@Sreemanth this is unfixable. This is directly in Cassandra (1)

We can not open Keyspace differently than here (2)

Using this plugin against virtual tables is not supported.

(1) https://github.com/apache/cassandra/blob/cassandra-4.1/src/java/org/apache/cassandra/db/Keyspace.java#L341-L342
(2) https://github.com/instaclustr/cassandra-lucene-index/blob/cassandra-4.1.0/plugin/src/main/scala/com/stratio/cassandra/lucene/IndexQueryHandler.scala#L129

@bschoening
Copy link

bschoening commented Sep 6, 2023

@smiklosovic should (2) above skip system_views? It already skips system_virtual_scheam:

if (select.keyspace() == "system_virtual_schema") { return Map.empty }

@smiklosovic smiklosovic reopened this Sep 7, 2023
@smiklosovic
Copy link
Collaborator

Ah yes, interesting, I overlooked that.

I merged it here (1), into cassandra-4.1.3. Should be easily cherry-picked to lower branches too.

(1) 994f470

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants