Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-1120

Support SELECT without FROM syntax (similar to MySQL)

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.4.0-incubating
    • Fix Version/s: 1.8.0
    • Component/s: core
    • Labels:
    • Environment:

      1.4.0-incubating

      Description

      Calcite is unable to parse "select 2+2;"

      when i try to parse the below query

      select 2+2;
      

      Me getting error as below

      org.apache.calcite.sql.parser.impl.ParseException: Encountered "<EOF>" at line 1, column 22.
      Was expecting one of:
          "FROM" ...
          "," ...
          "AS" ...
          <IDENTIFIER> ...
          <QUOTED_IDENTIFIER> ...
          <BACK_QUOTED_IDENTIFIER> ...
          <BRACKET_QUOTED_IDENTIFIER> ...
          <UNICODE_QUOTED_IDENTIFIER> ...
          "A" ...
          "ABSOLUTE" ...
          "ACTION" ...
          "ADA" ...
          "ADD" ...
          "ADMIN" ...
          "AFTER" ...
          "ALWAYS" ...
          "ASC" ...
          "ASSERTION" ...
          "ASSIGNMENT" ...
          "ATTRIBUTE" ...
          "ATTRIBUTES" ...
          "BEFORE" ...
          "BERNOULLI" ...
          "BREADTH" ...
          "C" ...
          "CASCADE" ...
          "CATALOG" ...
          "CATALOG_NAME" ...
          "CHAIN" ...
          "CHARACTER_SET_CATALOG" ...
          "CHARACTER_SET_NAME" ...
          "CHARACTER_SET_SCHEMA" ...
          "CHARACTERISTICTS" ...
          "CHARACTERS" ...
          "CLASS_ORIGIN" ...
          "COBOL" ...
          "COLLATION" ...
          "COLLATION_CATALOG" ...
          "COLLATION_NAME" ...
          "COLLATION_SCHEMA" ...
          "COLUMN_NAME" ...
          "COMMAND_FUNCTION" ...
          "COMMAND_FUNCTION_CODE" ...
          "COMMITTED" ...
          "CONDITION_NUMBER" ...
          "CONNECTION" ...
          "CONNECTION_NAME" ...
          "CONSTRAINT_CATALOG" ...
          "CONSTRAINT_NAME" ...
          "CONSTRAINT_SCHEMA" ...
          "CONSTRAINTS" ...
          "CONSTRUCTOR" ...
          "CONTAINS" ...
          "CONTINUE" ...
          "CURSOR_NAME" ...
          "DATA" ...
          "DATETIME_INTERVAL_CODE" ...
          "DATETIME_INTERVAL_PRECISION" ...
          "DEFAULTS" ...
          "DEFERRABLE" ...
          "DEFERRED" ...
          "DEFINED" ...
          "DEFINER" ...
          "DEGREE" ...
          "DEPTH" ...
          "DERIVED" ...
          "DESC" ...
          "DESCRIPTION" ...
          "DESCRIPTOR" ...
          "DIAGNOSTICS" ...
          "DISPATCH" ...
          "DOMAIN" ...
          "DYNAMIC_FUNCTION" ...
          "DYNAMIC_FUNCTION_CODE" ...
          "EQUALS" ...
          "EXCEPTION" ...
          "EXCLUDE" ...
          "EXCLUDING" ...
          "FINAL" ...
          "FIRST" ...
          "FOLLOWING" ...
          "FORTRAN" ...
          "FOUND" ...
          "G" ...
          "GENERAL" ...
          "GENERATED" ...
          "GO" ...
          "GOTO" ...
          "GRANTED" ...
          "HIERARCHY" ...
          "IMMEDIATE" ...
          "IMPLEMENTATION" ...
          "INCLUDING" ...
          "INCREMENT" ...
          "INITIALLY" ...
          "INPUT" ...
          "INSTANCE" ...
          "INSTANTIABLE" ...
          "INVOKER" ...
          "ISOLATION" ...
          "JAVA" ...
          "K" ...
          "KEY" ...
          "KEY_MEMBER" ...
          "KEY_TYPE" ...
          "LABEL" ...
          "LAST" ...
          "LENGTH" ...
          "LEVEL" ...
          "LIBRARY" ...
          "LOCATOR" ...
          "M" ...
          "MAP" ...
          "MATCHED" ...
          "MAXVALUE" ...
          "MESSAGE_LENGTH" ...
          "MESSAGE_OCTET_LENGTH" ...
          "MESSAGE_TEXT" ...
          "MINVALUE" ...
          "MORE" ...
          "MUMPS" ...
          "NAME" ...
          "NAMES" ...
          "NESTING" ...
          "NORMALIZED" ...
          "NULLABLE" ...
          "NULLS" ...
          "NUMBER" ...
          "OBJECT" ...
          "OCTETS" ...
          "OPTION" ...
          "OPTIONS" ...
          "ORDERING" ...
          "ORDINALITY" ...
          "OTHERS" ...
          "OUTPUT" ...
          "OVERRIDING" ...
          "PAD" ...
          "PARAMETER_MODE" ...
          "PARAMETER_NAME" ...
          "PARAMETER_ORDINAL_POSITION" ...
          "PARAMETER_SPECIFIC_CATALOG" ...
          "PARAMETER_SPECIFIC_NAME" ...
          "PARAMETER_SPECIFIC_SCHEMA" ...
          "PARTIAL" ...
          "PASCAL" ...
          "PASSTHROUGH" ...
          "PATH" ...
          "PLACING" ...
          "PLAN" ...
          "PLI" ...
          "PRECEDING" ...
          "PRESERVE" ...
          "PRIOR" ...
          "PRIVILEGES" ...
          "PUBLIC" ...
          "READ" ...
          "RELATIVE" ...
          "REPEATABLE" ...
          "RESTART" ...
          "RESTRICT" ...
          "RETURNED_CARDINALITY" ...
          "RETURNED_LENGTH" ...
          "RETURNED_OCTET_LENGTH" ...
          "RETURNED_SQLSTATE" ...
          "ROLE" ...
          "ROUTINE" ...
          "ROUTINE_CATALOG" ...
          "ROUTINE_NAME" ...
          "ROUTINE_SCHEMA" ...
          "ROW_COUNT" ...
          "SCALE" ...
          "SCHEMA" ...
          "SCHEMA_NAME" ...
          "SCOPE_CATALOGS" ...
          "SCOPE_NAME" ...
          "SCOPE_SCHEMA" ...
          "SECTION" ...
          "SECURITY" ...
          "SELF" ...
          "SEQUENCE" ...
          "SERIALIZABLE" ...
          "SERVER" ...
          "SERVER_NAME" ...
          "SESSION" ...
          "SETS" ...
          "SIMPLE" ...
          "SIZE" ...
          "SOURCE" ...
          "SPACE" ...
          "SPECIFIC_NAME" ...
          "STATE" ...
          "STATEMENT" ...
          "STRUCTURE" ...
          "STYLE" ...
          "SUBCLASS_ORIGIN" ...
          "SUBSTITUTE" ...
          "TABLE_NAME" ...
          "TEMPORARY" ...
          "TIES" ...
          "TOP_LEVEL_COUNT" ...
          "TRANSACTION" ...
          "TRANSACTIONS_ACTIVE" ...
          "TRANSACTIONS_COMMITTED" ...
          "TRANSACTIONS_ROLLED_BACK" ...
          "TRANSFORM" ...
          "TRANSFORMS" ...
          "TRIGGER_CATALOG" ...
          "TRIGGER_NAME" ...
          "TRIGGER_SCHEMA" ...
          "TYPE" ...
          "UNBOUNDED" ...
          "UNCOMMITTED" ...
          "UNDER" ...
          "UNNAMED" ...
          "USAGE" ...
          "USER_DEFINED_TYPE_CATALOG" ...
          "USER_DEFINED_TYPE_CODE" ...
          "USER_DEFINED_TYPE_NAME" ...
          "USER_DEFINED_TYPE_SCHEMA" ...
          "VERSION" ...
          "VIEW" ...
          "WRAPPER" ...
          "WORK" ...
          "WRITE" ...
          "XML" ...
          "ZONE" ...
          "NOT" ...
          "IN" ...
          "BETWEEN" ...
          "LIKE" ...
          "SIMILAR" ...
          "=" ...
          ">" ...
          "<" ...
          "<=" ...
          ">=" ...
          "<>" ...
          "+" ...
          "-" ...
          "*" ...
          "/" ...
          "||" ...
          "AND" ...
          "OR" ...
          "IS" ...
          "MEMBER" ...
          "SUBMULTISET" ...
          "MULTISET" ...
          "[" ...
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                julianhyde Julian Hyde
                Reporter:
                ShyamP Shyam
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: