SQL Assist and Autocomplete Improvements

SQL Assist and Autocomplete Improvements

We’ve recently made some nice improvements to the autocomplete and assist panel that should really boost the experience when working with the notebooks or editing SQL queries in the Hive and Impala query editors.

One of the major improvements is support for complex types; structs, maps and arrays, both in the assist and autocomplete. See more of the improvements below or take a look at the following video demo.

 

A longer more detailed version is available here.

 

Complex in a simple way…

The assist panel now support complex types for Hive and Impala. Just click on the column and it’ll expand any of the structs, maps and arrays.

We’ve made the assist panel resizable, which is very handy when you have long table or column names or deep nested structures.

Assist_complex

 

If you find what you’re looking for in the panel you can double-click the item to insert it at the cursor in the active editor. You can also drag-and-drop it anywhere in the editor if you prefer another location. It knows about the structure and will insert the reference with all the parents up to and including the column name.

 

Ctrl+space is your friend!

You can use ctrl+space anywhere in the editor to activate the autocomplete. It will make suggestion based on the schema and it will also take the contents of the statement that you’re editing into account. Apart from the SQL keywords, tables and columns it will even suggest user-defined aliases.

Autocomplete_join_alias

 

It knows about complex types for Hive and Impala and will make the appropriate suggestions based on the reference that you’re currently editing.

Autocomplete_nested_struct

 

I heard you like exploded views! The autocomplete will help you with these, it keeps track of the exploded views as well as exploded views of exploded views of exploded views of…

Autocomplete_exploded

 

Values and HDFS paths

We’ve even added sample values to the mix. It’s currently only available for Impala and it will suggest a subset of all the values, this is really nice when working with for instance map keys or to give you an idea of the data.

Autocomplete_sample_values

 

Last but not least, the autocomplete can now suggest HDFS paths. Just type ‘/’ in one of the notebook snippets and it will automatically open the autocomplete panel with the list of folders and files at that location, of course you can also activate it with ctrl+space when editing an existing path.

Autocomplete_hdfs

 

We’ll keep improving the assist and autocomplete experience (support for HBase, any JDBC database, HDFS…) and hope that these new features will be useful for you!

Feel free to send feedback on the hue-user list or @gethue!

20 Comments

  1. Imtiaz 2 years ago

    What version has these update?

    • Hue Team 2 years ago

      Master as of October 2015 or Hue 3.10 that should come in Q2 2016

  2. chouyoung 1 year ago

    how can hue connect with my hdp cluster which made by ambari-server

  3. xmda 1 year ago

    Is there a way for individual users to turn this off??

    • Hue Team 1 year ago

      Not really, sorry. For us to understand, why would you turn the feature off?

      • Mathew 1 year ago

        It’s really annoing that the suggestions pop up after each input. A individual delay of the popup would be really helpful for better user experience.

        • Author
          Hue Team 1 year ago

          Thanks, will play around with it. Currently we are following what the main editors do in order to save constant keystrokes. Note that a much smarter autocompleter is coming in the next release. Is your main worry the usefulness of the help provided or just the constant dropdown showing up?

  4. Pete 10 months ago

    I also find the new autocomplete annoying. The popups come way to quickly and it often chooses something from the list when I don’t want it.
    Even a space is causing suggestions. Hitting return then picks the thing on the top of the list, which for me is often 0., when all I want is to jump to a new line.

    Hitting return on an empty line does the same thing. Very annoying. Now I have to hit escape before any return to stop garbage from getting in the line.

  5. Dan Gustafsson 10 months ago

    The autocomplete is awsome, but alas, flawed.
    Please tune it so it does not complete spaces or enter-strokes. Please tune it so it does not complete immediately but waits a few seconds (maybe 1 sec).
    Maybe it is a good thing to be able to turn it off, and then use ctrl-space to get it when wanted.
    Btw, the hdfs-helper for paths is just excellent! And the general auto-complete function is super!

    • Author
      Hue Team 9 months ago

      In some tools the autocomplete is on by default, they are differences of taste. You could ‘CTRL+,’, uncheck the Live autocompletion, then use CTRL+SPACE to prompt it manually later.

      • Tom Stewart 9 months ago

        In Hue 3.10 or Hue 3.11 how do you turn off autocomplete? When I hit CTRL+, I get a pop-up menu on the right side but don’t see anything to uncheck Live autocompletion. I also can’t figure out how to save settings in that pop-up menu, for example I tried changing from Hive to Text and that didn’t save or help disable autocomplete. One of the reasons to disable is a slowdown as the lists grow large.

  6. MagoriNaHory 7 months ago

    Using Hue 3.10. Checkbox described here http://www.cloudera.com/documentation/enterprise/latest/topics/hue_use_autocompleter_flag.html is not available. Autocomplete is really annoing. Having use case for it 10% of time. 70% of time just correcting code to remove what was submitted accidentaly due to suggestion.
    On top of. If i hit ‘CTRL-,’ (With coma) and change for example theme of editor from default Chrome to Tomorow Night 80 s it is changed. However when i reload page all changes are gone. There is no way how to store user settings and keep them? I understand there is no submit buttom in popup left side panel with seting and i need just click back to edit, howere how i keep changes i did for myself till next time i log in to Hue?
    Is there a way to at least clear ‘history’ from suggestions?
    Thanks,
    Michal

    • Author
      Hue Team 7 months ago

      #1
      Do you have examples of autocomplete scenario or a video that shows what does not work? We 99% here the opposite about the new autocompleter.

      For #2 I created
      https://issues.cloudera.org/browse/HUE-5842

    • Author
      Hue Team 7 months ago

      Also, a quick hack to keep the theme would be, from your browser console, to run
      $.totalStorage('hue.ace.theme', 'ace/theme/tomorrow_night_eighties')

      • Aaron 6 months ago

        I also have issues with the autocomplete working on hue version 3.10.

        There are two behaviors that combine together to make it a real PIA for me.
        -For selecting an item of the available list presented, it really should only be keyed of one key. Currently it will enter the first item off the list using the ‘enter’ or ‘tab’ keys.
        -Autocomplete list pops up off any entry even the space key.

        With the way these two behaviors work together, I can’t even enter a blank line without having to hit escape or back arrow first.
        If I could turn it off, I would in a heartbeat, as I have to rework code quite often.
        I have learned to work around it, but it still gets me every once in a while.

        If you could change the autocomplete so it only enters a value on ‘tab’ it would make my life much easier.
        Sorry I cannot provide video, due to restrictions at our work. But would love to show you the problems I have with it.

        • Author
          Hue Team 6 months ago

          You can turn off the autocomplete by pressing CTRL + ,
          Then unchecking the Live autocompletion.

          Some developers prefer it off, some prefer it on, it is configurable with the above and will be more obvious soon how to configure it.

          • Steve 6 months ago

            I also wish to turn off the auto completer. ‘CTRL + ,’ or ‘CTRL -,’ brings up the editor menu but that doesn’t give me the ‘Live autocompletion’ checkbox. The only setting I see that may be related is a free text field for ‘Completers’ I tried leaving it blank, ‘off’, ‘false’ and typing random strings but nothing turns this feature off. Bizarrely, after trying this many times, I now no longer have the free text field for ‘Completers’ but now I have a checkbox that whether checked or unchecked, makes no difference to the Auto completion feature.

            The menu says ‘Ace version 1.2.2’.

  7. Andy Dennison 2 months ago

    I would like to turn this off too. Seriously: why would I want to change “AS” in a SQL query to ASCII?? Yet it tries to do this every time. AHHH

Leave a reply

Your email address will not be published. Required fields are marked *

*