title: ParseException line 6:5 cannot recognize input near '(' 'SELECT' 'system' in joinSource
body: <p>I am trying to execute a query in hive and getting the error. I check over and over again but I cannot see any problem.</p>
  
  <pre><code>CREATE view sta_v_clean_phrase_longtext (system, `function`, loglockmod, extinfo 
  , primarykey, foreignkey, flgprimkey, flgfrgnkey, ref_recn, text_line, copied, 
  inserted ) 
  AS 
    SELECT system, 
           `function`, 
           loglockmod, 
           extinfo, 
           primarykey, 
           foreignkey, 
           flgprimkey, 
           flgfrgnkey, 
           ref_recn, 
           Concat_ws('', Collect_list(text_line))AS TEXT_LINE, 
           copied 
    FROM  (SELECT system, 
                  `function`, 
                  loglockmod, 
                  extinfo, 
                  primarykey, 
                  foreignkey, 
                  flgprimkey, 
                  flgfrgnkey, 
                  ref_recn, 
                  text_line, 
                  copied 
           FROM   phrase_longtext_orc_orc 
           WHERE  primarykey IS NOT NULL 
           GROUP  BY system, 
                     `function`, 
                     loglockmod, 
                     extinfo, 
                     primarykey, 
                     foreignkey, 
                     flgprimkey, 
                     flgfrgnkey, 
                     ref_recn, 
                     text_line, 
                     copied) 
    GROUP  BY system, 
              `function`, 
              loglockmod, 
              extinfo, 
              primarykey, 
              foreignkey, 
              flgprimkey, 
              flgfrgnkey, 
              ref_recn, 
              text_line, 
              copied 
  </code></pre>
  
  <blockquote>
    <p>ParseException line 6:5 cannot recognize input near '(' 'SELECT'
    'system' in joinSource</p>
  </blockquote>