hiveql

override SemanticException [Error 10001]

假装没事ソ 提交于 2019-12-02 12:19:47
问题 I want to alter 1000s table in hive database, but some of their tables exits some doesn't. As I execute that .sql file, as soon as it found table not present, it exits from hive. so help me out to override or skip those queries whose table is not present in hive 回答1: Try this configuration parameter: set hive.cli.errors.ignore=true; After setting it to 'true', all commands in the script are executed, no matter how many failed. See here: https://issues.apache.org/jira/browse/HIVE-1847 来源:

Hive order by not visible column

独自空忆成欢 提交于 2019-12-02 11:33:14
Let's say I have table test with column a,b and c and test2 with same column. Can I create a view of table test and test 2 joined together and ordered by field c from table test without showing it in final output? In my case: CREATE VIEW AS test_view AS SELECT a,b FROM (SELECT * FROM test ORDER BY c) JOIN test2 ON test.a =test2.a; Ok I test it and it is not possible because shuffle phase so maybe there is another solution to somehow do it? Table are too big to do broadcast join. Of course I can do CREATE VIEW AS test_view AS SELECT a,b,c FROM test JOIN test2 ON test.a =test2.a ORDER BY c and

How transfer a Table from HBase to Hive?

半城伤御伤魂 提交于 2019-12-02 09:44:57
How can I tranfer a HBase table into Hive correctly? What I tried before can you read in this question How insert overwrite table in hive with diffrent where clauses? ( I made one table to import all data. The problem here is that data is still in rows and not in columns. So I made 3 tables for news, social and all with a specific where clause. After that I made 2 Joins on the tables which is giving me the result table. So I had 6 Tables at all which is not really performant!) to sum my problem up : In HBase are column familys which are saved as rows like this. count verpassen news 1 count

How to Join Two tables in HIVE.

旧街凉风 提交于 2019-12-02 09:04:37
问题 I have two tables A and B that both have the following structure. // Table A Name Age actualdate no // Table B City sdate edate id I wish to obtain all the fields from A and B using JOIN where, id = no and sdate <= actualdate and edate >= actualdate. I tried as below using where clause, but it's not working. select v3.*, t3.* from A v3 JOIN B t3 where v3.id = t3.no and v3.sdate <= t3.actualdate and v3.edate >= t3.actualdate limit 1; Using On clause : select v3.*, t3.* from A v3 JOIN B t3 ON (

How do we get the 1000 tables description using hive?

南楼画角 提交于 2019-12-02 08:59:20
问题 I have 1000 tables, need to check the describe <table name>; for one by one. Instead of running one by one, can you please give me one command to fetch "N" number of tables in a single shot. 回答1: You can make a shell script and call it with a parameter. For example following script receives schema, prepares list of tables in the schema, calls DESCRIBE EXTENDED command, extracts location, prints table location for first 1000 tables in the schema ordered by name. You can modify and use it as a

Facing issue in hive query in generating missing dates

岁酱吖の 提交于 2019-12-02 07:22:12
问题 I have a requirement where I need to go back to previous values for a column until 1000 rows and get those previous 1000 dates for my next steps , but all those 1000 previous dates are not present for that column in the table. But I need those missing dates to get from output of the query . When I try to run below query it is not displaying 1000 previous date values from current date Example lets say only 2 dates are available for date column date 2019-01-16 2019-01-19 I have come up with a

In hive,can we change location of managed/external table

↘锁芯ラ 提交于 2019-12-02 06:54:16
问题 In hive,can we change location of managed/external table if yes how. After changing location will it behave like external table or internal table 回答1: I tried to search this question but I didnt get a proper answer yes we can change the location of managed table if we add location CREATE TABLE weather (wban INT, date STRING, precip INT) ROW FORMAT DELIMITED FIELDS TERMINATED BY ‘,’ LOCATION ‘ /hive/data/weather’; After creation we can change location by the below command ALTER (DATABASE

Why do I get “File could only be replicated to 0 nodes” when writing to a partitioned table?

痞子三分冷 提交于 2019-12-02 06:53:00
问题 I create an external table in Hive with partitions and then try to populate it from the existing table, however, I get the following exceptions: Caused by: org.apache.hadoop.hive.ql.metadata.HiveException: org.apache.hadoop.ipc.RemoteException(java.io.IOException): File /apps/hive/warehouse/pavel.db/browserdatapart/.hive-staging_hive_2018-12-28_13-22-45_751_6056004898772238481-1/_task_tmp.-ext-10000/cityid=1/_tmp.000001_3 could only be replicated to 0 nodes instead of minReplication (=1).

Creating temp table from another table including partition column in hive

房东的猫 提交于 2019-12-02 06:42:19
问题 I am creating a temp table from another table using AS clause where I am including the partition column of another table also be part of temp table and then I am getting the below error. Below is the table create statement where col4 is the partition column of table xyz . And while running the create statement i am getting the below error. And when I am removing the col4 from the create statement its running fine. Error: Error while compiling statement: FAILED: NumberFormatException For input

NULL column names in Hive query result

旧街凉风 提交于 2019-12-02 05:55:13
问题 I have downloaded the weather .txt files from NOAA, which looks like: WBAN,Date,Time,StationType,SkyCondition,SkyConditionFlag,Visibility,VisibilityFlag,WeatherType,WeatherTypeFlag,DryBulbFarenheit,DryBulbFarenheitFlag,DryBulbCelsius,DryBulbCelsiusFlag,WetBulbFarenheit,WetBulbFarenheitFlag,WetBulbCelsius,WetBulbCelsiusFlag,DewPointFarenheit,DewPointFarenheitFlag,DewPointCelsius,DewPointCelsiusFlag,RelativeHumidity,RelativeHumidityFlag,WindSpeed,WindSpeedFlag,WindDirection,WindDirectionFlag