Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-13677

Cannot perform join on cursors for tables without columns

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Cursors
    • Environment:
      ubuntu
    • Storage Engines
    • StorEng - 2024-12-10

      Consider the following example (modified from one of the examples):

      session->create(session, "table:test", "key_format=S,value_format=S")
      session->open_cursor(session, "join:table:test", NULL, NULL, &join_cursor);
      session->open_cursor(session, "table:test", NULL, NULL, &country_cursor);
      session->open_cursor(session, "table:test", NULL, NULL, &country_cursor2);
      country_cursor->set_key(country_cursor, "A");
      country_cursor->search_near(country_cursor, &exact);
      
      country_cursor2->set_key(country_cursor2, "B");
      country_cursor2->search_near(country_cursor2, &exact);
      
      session->join(session, join_cursor, country_cursor, "compare=ge");
      session->join(session, join_cursor, country_cursor2, "compare=lt");
      

      The above example will complain that "

      color: Color value is invalid

      table for join cursor does not match table for ref_cursor". If I change the table definition to include (any number of) columns, it functions as expected.

       
      The problem seems to stem from the fact that for this type of table, the `table` entry of the cursor is actually: `

      color: Color value is invalid

      table->cgroups[0]->source`. 

      Is this a bug, or is it simply impossible to perform a join over a table with no columns?

      The scenario here is I want a trivial key(string)=>value(any) mapping in as light weight configuration as possible (i.e., I don't want a separate index).

      I need to be able to query the collection by sets of key prefixes, e.g., `[AAA -> AAZ]` or `[BBA -> BBZ]`. I believe I can achieve one range by using the `->bound` command, but that won't suffice for multiple ranges. 

      Is there any material difference of `"key_format=S,value_format=S"` and `"key_format=S,value_format=S,columns=(id,value)"` - it appears to result in the same structured wt file (though I haven't dug deeply into this)

            Assignee:
            backlog-server-storage-engines [DO NOT USE] Backlog - Storage Engines Team
            Reporter:
            zack@qualia.com Zack Newsham
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: