Uploaded image for project: 'Tajo'
  1. Tajo
  2. TAJO-1610

Cannot find column when the same name is used for table and database

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.11.0
    • Component/s: Planner/Optimizer
    • Labels:
      None

      Description

      See the title.
      You can reproduce as follows:

      tweets> CREATE EXTERNAL TABLE tweets (   coordinates TEXT,   favorited BOOL,   truncated BOOL,   created_at TIMESTAMP,   id_str TEXT,   /*entrities RECORD (     urls ARRAY<TEXT>   )*/   in_reply_to_user_id_str TEXT,   contributors TEXT,   text TEXT,   metadata RECORD (     iso_language_code TEXT,     result_type TEXT   ),   retweet_count INTEGER,   in_reply_to_status_id_str TEXT,   id TEXT,   geo TEXT,   retweeted BOOL,   in_reply_to_user_id TEXT,   place TEXT,   user RECORD (     profile_sidebar_fill_color TEXT,     profile_sidebar_border_color TEXT,     profile_background_tile TEXT,     name TEXT,     profile_image_url TEXT,     created_at TIMESTAMP,     location TEXT,     follow_request_sent TEXT,     profile_link_color TEXT,     is_translator BOOL,     id_str TEXT,     /*     entities RECORD (       url RECORD (       ),       description RECORD (       )     ), */     default_profile BOOL,     contributors_enabled BOOL,     favourites_count INTEGER,     url TEXT,     profile_image_url_https TEXT,     utc_offset INTEGER,     id BIGINT,     profile_use_background_image BOOL,     listed_count INTEGER,     profile_text_color TEXT,     lang TEXT,     followers_count INTEGER,     protected BOOL,     notifications TEXT,     profile_background_image_url_https TEXT,     profile_background_color TEXT,     verified TEXT,     geo_enabled TEXT,     time_zone TEXT,     description TEXT,     default_profile_image TEXT,     profile_background_image_url TEXT,     statuses_count INTEGER,     friends_count INTEGER,     following TEXT,     show_all_inline_media BOOL,     screen_name TEXT   ),   in_reply_to_screen_name TEXT,   source TEXT,   in_reply_to_status_id TEXT ) USING JSON LOCATION 'file://.../Projects/twitter_201407221120.log';
      OK
      tweets> \d
      tweets
      tweets> \d tweets
      
      table name: tweets.tweets
      table path: file://.../Projects/twitter_201407221120.log
      store type: json
      number of rows: unknown
      volume: 151.2 MB
      Options: 
      	'text.serde'='org.apache.tajo.storage.json.JsonLineSerDe'
      
      schema: 
      coordinates	TEXT
      favorited	BOOLEAN
      truncated	BOOLEAN
      created_at	TIMESTAMP
      id_str	TEXT
      in_reply_to_user_id_str	TEXT
      contributors	TEXT
      text	TEXT
      metadata	RECORD (iso_language_code TEXT, result_type TEXT)
      retweet_count	INT4
      in_reply_to_status_id_str	TEXT
      id	TEXT
      geo	TEXT
      retweeted	BOOLEAN
      in_reply_to_user_id	TEXT
      place	TEXT
      user	RECORD (profile_sidebar_fill_color TEXT, profile_sidebar_border_color TEXT, profile_background_tile TEXT, name TEXT, profile_image_url TEXT, created_at TIMESTAMP, location TEXT, follow_request_sent TEXT, profile_link_color TEXT, is_translator BOOLEAN, id_str TEXT, default_profile BOOLEAN, contributors_enabled BOOLEAN, favourites_count INT4, url TEXT, profile_image_url_https TEXT, utc_offset INT4, id INT8, profile_use_background_image BOOLEAN, listed_count INT4, profile_text_color TEXT, lang TEXT, followers_count INT4, protected BOOLEAN, notifications TEXT, profile_background_image_url_https TEXT, profile_background_color TEXT, verified TEXT, geo_enabled TEXT, time_zone TEXT, description TEXT, default_profile_image TEXT, profile_background_image_url TEXT, statuses_count INT4, friends_count INT4, following TEXT, show_all_inline_media BOOLEAN, screen_name TEXT)
      in_reply_to_screen_name	TEXT
      source	TEXT
      in_reply_to_status_id	TEXT
      
      
      tweets> select "text" from tweets limit 10;
      ERROR: column "tweets.tweets.text" does not exist
      

        Activity

        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Tajo-0.11.0-build #17 (See https://builds.apache.org/job/Tajo-0.11.0-build/17/)
        TAJO-1610: Cannot find column when the same name is used for table and database. (hyunsik: rev 19d1223ed510daf3b8ce3b323f803afdffe3694e)

        • tajo-plan/src/main/java/org/apache/tajo/plan/nameresolver/NameResolver.java
        • tajo-core-tests/src/test/resources/queries/TestSelectNestedRecord/testTAJO_1610.sql
        • tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestSelectNestedRecord.java
        • tajo-core-tests/src/test/resources/results/TestSelectNestedRecord/testTAJO_1610.result
        • CHANGES
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Tajo-0.11.0-build #17 (See https://builds.apache.org/job/Tajo-0.11.0-build/17/ ) TAJO-1610 : Cannot find column when the same name is used for table and database. (hyunsik: rev 19d1223ed510daf3b8ce3b323f803afdffe3694e) tajo-plan/src/main/java/org/apache/tajo/plan/nameresolver/NameResolver.java tajo-core-tests/src/test/resources/queries/TestSelectNestedRecord/testTAJO_1610.sql tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestSelectNestedRecord.java tajo-core-tests/src/test/resources/results/TestSelectNestedRecord/testTAJO_1610.result CHANGES
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Tajo-master-build #839 (See https://builds.apache.org/job/Tajo-master-build/839/)
        TAJO-1610: Cannot find column when the same name is used for table and database. (hyunsik: rev da40cb080facf468510392e6399a38acdf0bdffb)

        • tajo-core-tests/src/test/resources/queries/TestSelectNestedRecord/testTAJO_1610.sql
        • CHANGES
        • tajo-core-tests/src/test/resources/results/TestSelectNestedRecord/testTAJO_1610.result
        • tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestSelectNestedRecord.java
        • tajo-plan/src/main/java/org/apache/tajo/plan/nameresolver/NameResolver.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Tajo-master-build #839 (See https://builds.apache.org/job/Tajo-master-build/839/ ) TAJO-1610 : Cannot find column when the same name is used for table and database. (hyunsik: rev da40cb080facf468510392e6399a38acdf0bdffb) tajo-core-tests/src/test/resources/queries/TestSelectNestedRecord/testTAJO_1610.sql CHANGES tajo-core-tests/src/test/resources/results/TestSelectNestedRecord/testTAJO_1610.result tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestSelectNestedRecord.java tajo-plan/src/main/java/org/apache/tajo/plan/nameresolver/NameResolver.java
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Tajo-master-CODEGEN-build #482 (See https://builds.apache.org/job/Tajo-master-CODEGEN-build/482/)
        TAJO-1610: Cannot find column when the same name is used for table and database. (hyunsik: rev da40cb080facf468510392e6399a38acdf0bdffb)

        • CHANGES
        • tajo-plan/src/main/java/org/apache/tajo/plan/nameresolver/NameResolver.java
        • tajo-core-tests/src/test/resources/queries/TestSelectNestedRecord/testTAJO_1610.sql
        • tajo-core-tests/src/test/resources/results/TestSelectNestedRecord/testTAJO_1610.result
        • tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestSelectNestedRecord.java
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Tajo-master-CODEGEN-build #482 (See https://builds.apache.org/job/Tajo-master-CODEGEN-build/482/ ) TAJO-1610 : Cannot find column when the same name is used for table and database. (hyunsik: rev da40cb080facf468510392e6399a38acdf0bdffb) CHANGES tajo-plan/src/main/java/org/apache/tajo/plan/nameresolver/NameResolver.java tajo-core-tests/src/test/resources/queries/TestSelectNestedRecord/testTAJO_1610.sql tajo-core-tests/src/test/resources/results/TestSelectNestedRecord/testTAJO_1610.result tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestSelectNestedRecord.java
        Hide
        hyunsik Hyunsik Choi added a comment -

        committed.

        Show
        hyunsik Hyunsik Choi added a comment - committed.
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user asfgit closed the pull request at:

        https://github.com/apache/tajo/pull/735

        Show
        githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/tajo/pull/735
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user jihoonson commented on the pull request:

        https://github.com/apache/tajo/pull/735#issuecomment-138267667

        +1 LGTM!

        Show
        githubbot ASF GitHub Bot added a comment - Github user jihoonson commented on the pull request: https://github.com/apache/tajo/pull/735#issuecomment-138267667 +1 LGTM!
        Hide
        githubbot ASF GitHub Bot added a comment -

        GitHub user hyunsik opened a pull request:

        https://github.com/apache/tajo/pull/735

        TAJO-1610: Cannot find column when the same name is used for table and database.

        See https://issues.apache.org/jira/browse/TAJO-1610.

        You can merge this pull request into a Git repository by running:

        $ git pull https://github.com/hyunsik/tajo TAJO-1610

        Alternatively you can review and apply these changes as the patch at:

        https://github.com/apache/tajo/pull/735.patch

        To close this pull request, make a commit to your master/trunk branch
        with (at least) the following in the commit message:

        This closes #735


        commit a14bcf0f1a8abb1804d9d8dba1f13fb2526cb66c
        Author: Hyunsik Choi <hyunsik@apache.org>
        Date: 2015-09-07T05:48:47Z

        TAJO-1610: Cannot find column when the same name is used for table and database.


        Show
        githubbot ASF GitHub Bot added a comment - GitHub user hyunsik opened a pull request: https://github.com/apache/tajo/pull/735 TAJO-1610 : Cannot find column when the same name is used for table and database. See https://issues.apache.org/jira/browse/TAJO-1610 . You can merge this pull request into a Git repository by running: $ git pull https://github.com/hyunsik/tajo TAJO-1610 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tajo/pull/735.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #735 commit a14bcf0f1a8abb1804d9d8dba1f13fb2526cb66c Author: Hyunsik Choi <hyunsik@apache.org> Date: 2015-09-07T05:48:47Z TAJO-1610 : Cannot find column when the same name is used for table and database.

          People

          • Assignee:
            hyunsik Hyunsik Choi
            Reporter:
            jihoonson Jihoon Son
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development