You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Brad Schoening (Jira)" <ji...@apache.org> on 2022/09/21 01:24:00 UTC

[jira] [Comment Edited] (CASSANDRA-17879) It is not possible to autocomplete "WITH" when creating materialized view

    [ https://issues.apache.org/jira/browse/CASSANDRA-17879?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17607445#comment-17607445 ] 

Brad Schoening edited comment on CASSANDRA-17879 at 9/21/22 1:23 AM:
---------------------------------------------------------------------

In cql3handling.py, it uses this completer_for syntax with and without a decorator, for example:
{code:java}
@completer_for('createColumnFamilyStatement', 'wat')
def create_cf_wat_completer(ctxt, cass):
    # would prefer to get rid of the "columnfamily" nomenclature in cql3
    if ctxt.get_binding('partial', '') == '':
        return ['TABLE']
    return ['TABLE', 'COLUMNFAMILY']
{code}
 
{code:java}
@completer_for('createColumnFamilyStatement', 'dot')
def create_cf_ks_dot_completer(ctxt, cass):
    ks = dequote_name(ctxt.get_binding('ks'))
    if ks in cass.get_keyspace_names():
        return ['.']
    return []
{code}
 

 
{code:java}
completer_for('columnFamilyName', 'ksname')(cf_ks_name_completer)
completer_for('materializedViewName', 'ksname')(cf_ks_name_completer)
{code}
but there doesn't appear to be one for createMaterializedView:
{code:java}
% grep completer_for cql3handling.py | grep create
@completer_for('createKeyspaceStatement', 'wat')
@completer_for('createColumnFamilyStatement', 'wat')
@completer_for('createColumnFamilyStatement', 'dot')
@completer_for('createIndexStatement', 'col')
{code}
It seems there is some cleanup and refactoring needed here to remove the obsolete columnfamily nomenclature before replicating this for createMaterializedView.  I'm not really following the logic in the code here.

 

 


was (Author: bschoeni):
In cql3handling.py, it uses this @completer_for syntax, for example:

 
{code:java}
@completer_for('createColumnFamilyStatement', 'wat')
def create_cf_wat_completer(ctxt, cass):
    # would prefer to get rid of the "columnfamily" nomenclature in cql3
    if ctxt.get_binding('partial', '') == '':
        return ['TABLE']
    return ['TABLE', 'COLUMNFAMILY']
{code}
 
{code:java}
@completer_for('createColumnFamilyStatement', 'dot')
def create_cf_ks_dot_completer(ctxt, cass):
    ks = dequote_name(ctxt.get_binding('ks'))
    if ks in cass.get_keyspace_names():
        return ['.']
    return []
{code}
 

but there doesn't appear to be one for createMaterializedView:

 
{code:java}
% grep completer_for cql3handling.py | grep create
@completer_for('createKeyspaceStatement', 'wat')
@completer_for('createColumnFamilyStatement', 'wat')
@completer_for('createColumnFamilyStatement', 'dot')
@completer_for('createIndexStatement', 'col')
{code}
It seems there is some cleanup and refactoring needed here to remove the obsolete columnfamily nomenclature before replicating this for createMaterializedView.

 

 

> It is not possible to autocomplete "WITH" when creating materialized view
> -------------------------------------------------------------------------
>
>                 Key: CASSANDRA-17879
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-17879
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Stefan Miklosovic
>            Priority: Normal
>
> I noticed that when I type this:
> {code}
> CREATE MATERIALIZED VIEW ks.mv2 AS SELECT * FROM t WHERE k IS NOT NULL AND c1 IS NOT NULL AND c2 IS NOT NULL PRIMARY KEY (c1,k,c2) <TAB>
> {code}
> nothing happens after pressing tab, there should be options shown as for table case.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org