Uploaded image for project: 'CDH (READ-ONLY)'
  1. CDH (READ-ONLY)
  2. DISTRO-682

Simple queries fail with permissions error on scratch dir when querying read-only tables in HDFS

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: CDH 5.3.0
    • Fix Version/s: None
    • Component/s: Hive
    • Labels:
      None
    • Environment:
      Linux

      Description

      When attempting to do a simple query from a read-only directory in HDFS, Hive throws an error:

      hive> select * from roschema.rotable limit 1;
      FAILED: RuntimeException Cannot create staging directory 'hdfs://namespace1/roschema/rotable/.hive-staging_hive_2015-01-13_11-46-26_360_6089305184846884137-1': Permission denied: user=cecondit, access=WRITE, inode="/roschema/rotable":other-user:other-group:drwxr-xr-x

      Hive appears to be trying to create the scratch directory under the SOURCE table directory, which fails as the current user doesn't have write access.

      However, executing this query works:

      select * from (select * from roschema.rotable limit 1) a;

      However, this results in a MR job being kicked off. There appears to be no way to do simple ad-hoc limit queries without triggering the error.

      To reproduce, simply create a table as one user, and attempt to query it as another. If the query user doesn't have write access to the source table, the error occurs.

      I suspect this occurs in 5.2.1 as well based on the changelog, but that hasn't been verified here.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              ccondit Craig Condit
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: