Sqoop
  1. Sqoop
  2. SQOOP-312

Support for hive dynamic partitions with SQOOP import

    Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Currently in order to populate hive table dynamic partitions using Sqoop import we need to perform the following steps.
      1. Need to analyze the db table and identify the distinct values to be partitioned column
      2. If there are n distinct values for the column then we need to create n different SQOOP import commands, each having the corresponding where clause to pick the specific data corresponding to the value along with --hive-partition-key <key-name/column name> and --hive-partition-value <value-string/column value>.
      This approach becomes a bottle neck in case of larger tables that spawns millions of rows. Such tables should be partitioned in hive and there could at lest 300 to 500 partitions, ie 300 to 500 Sqoop imports.
      We are currently overcoming this hurdle by the following tweak
      1. Sqoop import the whole db table into a non partitioned hive table
      2. Manually create a partition based hive table
      3. Use hive QL to parse the data from non partitioned hive table to the corresponding partitions in the partitioned hive table.

      Expecting some parameters in SQOOP import to execute the following within SQOOP itself.

        Issue Links

          Activity

          Hide
          Venkat Ranganathan added a comment -

          HCatalog integration has been added as part of 1.4.4

          A dynamic partition is one where the partitioning keys are specified in Hive and the corresponding values are coming from DB columns instead of a specific set of values as in static partitioning. And the --hive-partitioning-key and value can be used to specify the static partitioning key as before.

          Thanks

          Show
          Venkat Ranganathan added a comment - HCatalog integration has been added as part of 1.4.4 A dynamic partition is one where the partitioning keys are specified in Hive and the corresponding values are coming from DB columns instead of a specific set of values as in static partitioning. And the --hive-partitioning-key and value can be used to specify the static partitioning key as before. Thanks
          Hide
          Sonya Ling added a comment -

          Venkat, I checked the release 1.4.4. It does look like including the dynamic partition fix mentioned. Which release will this fix be in. How do I specify hive-partition-value in this case? Thanks.

          Show
          Sonya Ling added a comment - Venkat, I checked the release 1.4.4. It does look like including the dynamic partition fix mentioned. Which release will this fix be in. How do I specify hive-partition-value in this case? Thanks.
          Hide
          Venkat Ranganathan added a comment -

          This should now work with SQOOP-913 having been committed

          Show
          Venkat Ranganathan added a comment - This should now work with SQOOP-913 having been committed

            People

            • Assignee:
              Unassigned
              Reporter:
              Bejoy KS
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:

                Development