<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question hive query error : Error encountered near token 'TOK_TMP_FILE' in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/hive-query-error-Error-encountered-near-token-TOK-TMP-FILE/m-p/338865#M232945</link>
    <description>&lt;P&gt;I am getting following error while running the tpch query&lt;/P&gt;&lt;P&gt;I saw the following link related to error (&lt;A href="https://issues.apache.org/jira/browse/HIVE-11427" target="_blank" rel="noopener"&gt;https://issues.apache.org/jira/browse/HIVE-11427&lt;/A&gt;) but not sure how to use this.&lt;/P&gt;&lt;P&gt;I am using:&amp;nbsp;&lt;SPAN class="s1"&gt;Hive 3.1.3000.7.1.6.0-297&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Error: Error &lt;SPAN&gt;while &lt;/SPAN&gt;compiling statement: FAILED: SemanticException 0:0 Error creating temporary folder on: hdfs://testmach:8020/apps/hive/warehouse/tpch_flat_orc_2.db. Error encountered near token &lt;SPAN&gt;'TOK_TMP_FILE' &lt;/SPAN&gt;(state=42000,code=&lt;SPAN&gt;40000&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;0: jdbc:hive2://testmach:10000&amp;gt; use tpch_flat_orc_120;
INFO  : Compiling command(queryId=hive_20220317154641_5560d6bf-4866-48b0-a990-9c5ea44f6dbd): use tpch_flat_orc_120
INFO  : Semantic Analysis Completed (retrial = false)
INFO  : Created Hive schema: Schema(fieldSchemas:null, properties:null)
INFO  : Completed compiling command(queryId=hive_20220317154641_5560d6bf-4866-48b0-a990-9c5ea44f6dbd); Time taken: 0.017 seconds
INFO  : Executing command(queryId=hive_20220317154641_5560d6bf-4866-48b0-a990-9c5ea44f6dbd): use tpch_flat_orc_120
INFO  : Starting task [Stage-0:DDL] in serial mode
INFO  : Completed executing command(queryId=hive_20220317154641_5560d6bf-4866-48b0-a990-9c5ea44f6dbd); Time taken: 0.015 seconds
INFO  : OK
No rows affected (0.049 seconds)
0: jdbc:hive2://testmach:10000&amp;gt; 
0: jdbc:hive2://testmach:10000&amp;gt; 
0: jdbc:hive2://testmach:10000&amp;gt; Beeline version 3.1.3000.7.1.6.0-297 by Apache Hive
0: jdbc:hive2://testmach:10000&amp;gt; use tpch_flat_orc_2;
INFO  : Compiling command(queryId=hive_20220317154646_e6389298-4543-45cf-bfbd-7cac999f299c): use tpch_flat_orc_2
INFO  : Semantic Analysis Completed (retrial = false)
INFO  : Created Hive schema: Schema(fieldSchemas:null, properties:null)
INFO  : Completed compiling command(queryId=hive_20220317154646_e6389298-4543-45cf-bfbd-7cac999f299c); Time taken: 0.008 seconds
INFO  : Executing command(queryId=hive_20220317154646_e6389298-4543-45cf-bfbd-7cac999f299c): use tpch_flat_orc_2
INFO  : Starting task [Stage-0:DDL] in serial mode
INFO  : Completed executing command(queryId=hive_20220317154646_e6389298-4543-45cf-bfbd-7cac999f299c); Time taken: 0.01 seconds
INFO  : OK
No rows affected (0.034 seconds)
0: jdbc:hive2://testmach:10000&amp;gt;  source tpch_query18.sql;
22/03/17 15:47:09 [main]: WARN conf.HiveConf: HiveConf of name hive.masking.algo does not exist
INFO  : Compiling command(queryId=hive_20220317154709_026bc1c2-6bf0-4bd3-8c63-a48d50ea3dba): drop view q18_tmp_cached
INFO  : Semantic Analysis Completed (retrial = false)
INFO  : Created Hive schema: Schema(fieldSchemas:null, properties:null)
INFO  : Completed compiling command(queryId=hive_20220317154709_026bc1c2-6bf0-4bd3-8c63-a48d50ea3dba); Time taken: 0.035 seconds
INFO  : Executing command(queryId=hive_20220317154709_026bc1c2-6bf0-4bd3-8c63-a48d50ea3dba): drop view q18_tmp_cached
INFO  : Starting task [Stage-0:DDL] in serial mode
INFO  : Completed executing command(queryId=hive_20220317154709_026bc1c2-6bf0-4bd3-8c63-a48d50ea3dba); Time taken: 0.07 seconds
INFO  : OK
No rows affected (0.127 seconds)
INFO  : Compiling command(queryId=hive_20220317154709_9128d000-bb7e-43c8-876b-074f753c980a): drop table q18_large_volume_customer_cached
INFO  : Semantic Analysis Completed (retrial = false)
INFO  : Created Hive schema: Schema(fieldSchemas:null, properties:null)
INFO  : Completed compiling command(queryId=hive_20220317154709_9128d000-bb7e-43c8-876b-074f753c980a); Time taken: 0.018 seconds
INFO  : Executing command(queryId=hive_20220317154709_9128d000-bb7e-43c8-876b-074f753c980a): drop table q18_large_volume_customer_cached
INFO  : Starting task [Stage-0:DDL] in serial mode
INFO  : Completed executing command(queryId=hive_20220317154709_9128d000-bb7e-43c8-876b-074f753c980a); Time taken: 0.012 seconds
INFO  : OK
No rows affected (0.049 seconds)
INFO  : Compiling command(queryId=hive_20220317154709_a234bdff-3fb7-4cb2-a808-17d30baf1a20): create view q18_tmp_cached as
select
	l_orderkey,
	sum(l_quantity) as t_sum_quantity
from
	lineitem
where
	l_orderkey is not null
group by
	l_orderkey
INFO  : Semantic Analysis Completed (retrial = false)
INFO  : Created Hive schema: Schema(fieldSchemas:[FieldSchema(name:l_orderkey, type:bigint, comment:null), FieldSchema(name:t_sum_quantity, type:double, comment:null)], properties:null)
INFO  : Completed compiling command(queryId=hive_20220317154709_a234bdff-3fb7-4cb2-a808-17d30baf1a20); Time taken: 0.08 seconds
INFO  : Executing command(queryId=hive_20220317154709_a234bdff-3fb7-4cb2-a808-17d30baf1a20): create view q18_tmp_cached as
select
	l_orderkey,
	sum(l_quantity) as t_sum_quantity
from
	lineitem
where
	l_orderkey is not null
group by
	l_orderkey
INFO  : Starting task [Stage-1:DDL] in serial mode
INFO  : Completed executing command(queryId=hive_20220317154709_a234bdff-3fb7-4cb2-a808-17d30baf1a20); Time taken: 0.033 seconds
INFO  : OK
No rows affected (0.153 seconds)
Error: Error while compiling statement: FAILED: SemanticException 0:0 Error creating temporary folder on: hdfs://testmach:8020/apps/hive/warehouse/tpch_flat_orc_2.db. Error encountered near token 'TOK_TMP_FILE' (state=42000,code=40000)
0: jdbc:hive2://testmach:10000&amp;gt; &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 17 Mar 2022 15:55:33 GMT</pubDate>
    <dc:creator>Ane</dc:creator>
    <dc:date>2022-03-17T15:55:33Z</dc:date>
    <item>
      <title>hive query error : Error encountered near token 'TOK_TMP_FILE'</title>
      <link>https://community.cloudera.com/t5/Support-Questions/hive-query-error-Error-encountered-near-token-TOK-TMP-FILE/m-p/338865#M232945</link>
      <description>&lt;P&gt;I am getting following error while running the tpch query&lt;/P&gt;&lt;P&gt;I saw the following link related to error (&lt;A href="https://issues.apache.org/jira/browse/HIVE-11427" target="_blank" rel="noopener"&gt;https://issues.apache.org/jira/browse/HIVE-11427&lt;/A&gt;) but not sure how to use this.&lt;/P&gt;&lt;P&gt;I am using:&amp;nbsp;&lt;SPAN class="s1"&gt;Hive 3.1.3000.7.1.6.0-297&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Error: Error &lt;SPAN&gt;while &lt;/SPAN&gt;compiling statement: FAILED: SemanticException 0:0 Error creating temporary folder on: hdfs://testmach:8020/apps/hive/warehouse/tpch_flat_orc_2.db. Error encountered near token &lt;SPAN&gt;'TOK_TMP_FILE' &lt;/SPAN&gt;(state=42000,code=&lt;SPAN&gt;40000&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;0: jdbc:hive2://testmach:10000&amp;gt; use tpch_flat_orc_120;
INFO  : Compiling command(queryId=hive_20220317154641_5560d6bf-4866-48b0-a990-9c5ea44f6dbd): use tpch_flat_orc_120
INFO  : Semantic Analysis Completed (retrial = false)
INFO  : Created Hive schema: Schema(fieldSchemas:null, properties:null)
INFO  : Completed compiling command(queryId=hive_20220317154641_5560d6bf-4866-48b0-a990-9c5ea44f6dbd); Time taken: 0.017 seconds
INFO  : Executing command(queryId=hive_20220317154641_5560d6bf-4866-48b0-a990-9c5ea44f6dbd): use tpch_flat_orc_120
INFO  : Starting task [Stage-0:DDL] in serial mode
INFO  : Completed executing command(queryId=hive_20220317154641_5560d6bf-4866-48b0-a990-9c5ea44f6dbd); Time taken: 0.015 seconds
INFO  : OK
No rows affected (0.049 seconds)
0: jdbc:hive2://testmach:10000&amp;gt; 
0: jdbc:hive2://testmach:10000&amp;gt; 
0: jdbc:hive2://testmach:10000&amp;gt; Beeline version 3.1.3000.7.1.6.0-297 by Apache Hive
0: jdbc:hive2://testmach:10000&amp;gt; use tpch_flat_orc_2;
INFO  : Compiling command(queryId=hive_20220317154646_e6389298-4543-45cf-bfbd-7cac999f299c): use tpch_flat_orc_2
INFO  : Semantic Analysis Completed (retrial = false)
INFO  : Created Hive schema: Schema(fieldSchemas:null, properties:null)
INFO  : Completed compiling command(queryId=hive_20220317154646_e6389298-4543-45cf-bfbd-7cac999f299c); Time taken: 0.008 seconds
INFO  : Executing command(queryId=hive_20220317154646_e6389298-4543-45cf-bfbd-7cac999f299c): use tpch_flat_orc_2
INFO  : Starting task [Stage-0:DDL] in serial mode
INFO  : Completed executing command(queryId=hive_20220317154646_e6389298-4543-45cf-bfbd-7cac999f299c); Time taken: 0.01 seconds
INFO  : OK
No rows affected (0.034 seconds)
0: jdbc:hive2://testmach:10000&amp;gt;  source tpch_query18.sql;
22/03/17 15:47:09 [main]: WARN conf.HiveConf: HiveConf of name hive.masking.algo does not exist
INFO  : Compiling command(queryId=hive_20220317154709_026bc1c2-6bf0-4bd3-8c63-a48d50ea3dba): drop view q18_tmp_cached
INFO  : Semantic Analysis Completed (retrial = false)
INFO  : Created Hive schema: Schema(fieldSchemas:null, properties:null)
INFO  : Completed compiling command(queryId=hive_20220317154709_026bc1c2-6bf0-4bd3-8c63-a48d50ea3dba); Time taken: 0.035 seconds
INFO  : Executing command(queryId=hive_20220317154709_026bc1c2-6bf0-4bd3-8c63-a48d50ea3dba): drop view q18_tmp_cached
INFO  : Starting task [Stage-0:DDL] in serial mode
INFO  : Completed executing command(queryId=hive_20220317154709_026bc1c2-6bf0-4bd3-8c63-a48d50ea3dba); Time taken: 0.07 seconds
INFO  : OK
No rows affected (0.127 seconds)
INFO  : Compiling command(queryId=hive_20220317154709_9128d000-bb7e-43c8-876b-074f753c980a): drop table q18_large_volume_customer_cached
INFO  : Semantic Analysis Completed (retrial = false)
INFO  : Created Hive schema: Schema(fieldSchemas:null, properties:null)
INFO  : Completed compiling command(queryId=hive_20220317154709_9128d000-bb7e-43c8-876b-074f753c980a); Time taken: 0.018 seconds
INFO  : Executing command(queryId=hive_20220317154709_9128d000-bb7e-43c8-876b-074f753c980a): drop table q18_large_volume_customer_cached
INFO  : Starting task [Stage-0:DDL] in serial mode
INFO  : Completed executing command(queryId=hive_20220317154709_9128d000-bb7e-43c8-876b-074f753c980a); Time taken: 0.012 seconds
INFO  : OK
No rows affected (0.049 seconds)
INFO  : Compiling command(queryId=hive_20220317154709_a234bdff-3fb7-4cb2-a808-17d30baf1a20): create view q18_tmp_cached as
select
	l_orderkey,
	sum(l_quantity) as t_sum_quantity
from
	lineitem
where
	l_orderkey is not null
group by
	l_orderkey
INFO  : Semantic Analysis Completed (retrial = false)
INFO  : Created Hive schema: Schema(fieldSchemas:[FieldSchema(name:l_orderkey, type:bigint, comment:null), FieldSchema(name:t_sum_quantity, type:double, comment:null)], properties:null)
INFO  : Completed compiling command(queryId=hive_20220317154709_a234bdff-3fb7-4cb2-a808-17d30baf1a20); Time taken: 0.08 seconds
INFO  : Executing command(queryId=hive_20220317154709_a234bdff-3fb7-4cb2-a808-17d30baf1a20): create view q18_tmp_cached as
select
	l_orderkey,
	sum(l_quantity) as t_sum_quantity
from
	lineitem
where
	l_orderkey is not null
group by
	l_orderkey
INFO  : Starting task [Stage-1:DDL] in serial mode
INFO  : Completed executing command(queryId=hive_20220317154709_a234bdff-3fb7-4cb2-a808-17d30baf1a20); Time taken: 0.033 seconds
INFO  : OK
No rows affected (0.153 seconds)
Error: Error while compiling statement: FAILED: SemanticException 0:0 Error creating temporary folder on: hdfs://testmach:8020/apps/hive/warehouse/tpch_flat_orc_2.db. Error encountered near token 'TOK_TMP_FILE' (state=42000,code=40000)
0: jdbc:hive2://testmach:10000&amp;gt; &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Mar 2022 15:55:33 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/hive-query-error-Error-encountered-near-token-TOK-TMP-FILE/m-p/338865#M232945</guid>
      <dc:creator>Ane</dc:creator>
      <dc:date>2022-03-17T15:55:33Z</dc:date>
    </item>
    <item>
      <title>Re: hive query error : Error encountered near token 'TOK_TMP_FILE'</title>
      <link>https://community.cloudera.com/t5/Support-Questions/hive-query-error-Error-encountered-near-token-TOK-TMP-FILE/m-p/339134#M233053</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/95579"&gt;@Ane&lt;/a&gt;&amp;nbsp;can you give a try by explicitly mentioning target database before calling CTAS.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;use &amp;lt;target_database&amp;gt;&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 22 Mar 2022 17:40:31 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/hive-query-error-Error-encountered-near-token-TOK-TMP-FILE/m-p/339134#M233053</guid>
      <dc:creator>marudhu_ramaiah</dc:creator>
      <dc:date>2022-03-22T17:40:31Z</dc:date>
    </item>
  </channel>
</rss>

