Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-7711

Explain the case-sensitivity of schema and table/cache

    XMLWordPrintableJSON

Details

    • Task
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • None
    • 2.7
    • documentation
    • None

    Description

      Users don't get how to use table and schema name in Ignite:

      https://stackoverflow.com/questions/48723946/apache-ignite-querying-a-cache-through-an-sql-driver

      The confusion comes from the interpretation of term "case-insensitive". All SQL databases work this way:
       
      1) If I create some object and define its name without quotes, a database will convert it to upper case (sometimes lower case). Then if I query this object without quotes, a query is also transformed to upper case. This is what I call "case-insensitivity" - it doesn't matter how you refer to this object, it works still.
      CREATE TABLE myTable -> CREATE TABLE MYTABLE
      SELECT FROM myTable -> SELECT FROM MYTABLE -> OK
      SELECT FROM MyTable -> SELECT FROM MYTABLE -> OK
      SELECT FROM "myTable" -> SELECT FROM myTable -> FAIL!
       
      2) If I create an object with quotes, then the database doesn't convert it to upper case, and the original name in quotes is the only way to access the object:
      CREATE TABLE "myTable" -> CREATE TABLE myTable
      SELECT FROM myTable -> SELECT FROM MYTABLE -> FAIL!
      SELECT FROM MyTable -> SELECT FROM MYTABLE -> *FAIL!*SELECT FROM "myTable" -> SELECT FROM myTable -> OK
       
      Now back to Ignite case. Our schemas are case-sensitive. so the only way to access it is through quotes:
      CREATE SCHEMA "cacheName"; // This is what Ignite does internally
      SELECT * FROM "cacheName".myTable -> OK
      SELECT * FROM cacheName.myTable -> FAIL!
       
      Our users know this, and all their queries are written with schema names in quotation marks. Now consider what would happen should we change schema names to case-insensitive mode:
      CREATE SCHEMA cacheName;

      SELECT * FROM "cacheName".myTable -> FAIL, all old quries start to fail!

      SELECT * FROM cacheName.myTable -> OK, now it works

      Attachments

        Activity

          People

            Unassigned Unassigned
            dmagda Denis A. Magda
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: