Details

    • Type: Sub-task Sub-task
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Query Processor
    • Labels:
      None

      Description

      Currently variable can only be assigned by a constant. There are cases where a query generate a single value that should be used by the second query. It would be nice to assign this value to a variable and pass it to the second query. For exmaple:

      hive> set x_avg = `select avg(x) from T`;
      hive> select my_udf(${hiveconf:x_avg}, y) from T2;
      

        Activity

        Hide
        Edward Capriolo added a comment -

        I was thinking about this. Getting 1 row result is simple enough. We can tap the the result set as it streamed back to it and store it and provide access with something like: $

        {LASTROW}

        [0]. The question is how many of these type of features do we need before should tackle a stored procedure like language.

        Show
        Edward Capriolo added a comment - I was thinking about this. Getting 1 row result is simple enough. We can tap the the result set as it streamed back to it and store it and provide access with something like: $ {LASTROW} [0] . The question is how many of these type of features do we need before should tackle a stored procedure like language.
        Hide
        Ning Zhang added a comment -

        Yeah, I think we should draw a line between a necessary feature and a whole SP language. This small feature can solve some cases that prevent hive from being a data flow processing language itself, but I don't think a lot of features in SP language is necessary because they can be implemented by Hive's UDFs (transform etc.). And UDFs have the benefits of pushing down computation close to data. So I think implementing a full-blown SP's control flow is an overkill and unnecessary, but some small feature like this has its value.

        Show
        Ning Zhang added a comment - Yeah, I think we should draw a line between a necessary feature and a whole SP language. This small feature can solve some cases that prevent hive from being a data flow processing language itself, but I don't think a lot of features in SP language is necessary because they can be implemented by Hive's UDFs (transform etc.). And UDFs have the benefits of pushing down computation close to data. So I think implementing a full-blown SP's control flow is an overkill and unnecessary, but some small feature like this has its value.

          People

          • Assignee:
            Unassigned
            Reporter:
            Ning Zhang
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:

              Development