Member since
10-28-2014
6
Posts
2
Kudos Received
2
Solutions
My Accepted Solutions
Title | Views | Posted |
---|---|---|
3957 | 02-13-2015 02:06 AM | |
3637 | 02-12-2015 11:13 PM |
02-16-2015
12:42 AM
A million time thanks to you, May God bless you. It worked beautilfully, iam trying understand the code you have written.
... View more
02-13-2015
02:06 AM
Hi, thanks for quick reply but my impala version not supporting trunc and extract so I have to do like this select now(), concat( cast(seconds_add(hour(now()), (minute(now()) - minute(now()) % 15) * 60) as string), ' to ', cast(seconds_add(hour(now()), (minute(now()) - minute(now()) % 15) * 60 + 899) as string)) timeslot; But it is giving an error AnalysisException: No matching function with those arguments: seconds_add (INT, BIGINT)
... View more
02-12-2015
11:22 PM
Hi All I have to create a 15 minute time slot in a report,but Iam unable to do so. The table structure is this CallingCountry CalledCountry TimeStamp Call Duration(Sec) ---------------------------------------------------------------------- India USA 2015-01-01 10:00:00 45 India USA 2015-01-01 10:01:00 30 India USA 2015-01-01 10:05:00 15 India USA 2015-01-01 10:14:00 40 So the Output will be India- USA 2015-01-01 10:00:00 to 2015-01-01 10:14:59 130 There will be more country like this the date wil be fix it will be in filter. I just want a 15 min time slot for a fixed date chosen by user. I tried many codes but failed,please help me. Any ideas will be appreciated.
... View more
Labels:
- Labels:
-
Apache Impala
02-12-2015
11:13 PM
1 Kudo
Hi, I found an alternative solution from events e JOIN l_CountryCode vcc1 on (substring(e.callingnumber,1,1)=substring(vcc1.country_code,1,1) and substring(e.callingnumber,1,length(vcc1.country_code))=vcc1.country_code)
... View more
02-11-2015
11:01 PM
Hi, I have two tables in impala,in first table one of the column is mobile number and second table I have country_code and country_name. Table events Column1 Column2 .... CallingNumber CalledNumber....Columnn ----------------------------------------------------------------------------- Some Data ...... 917878999777 2347878999777 Table l_countrycode Country_Code Country_Name ------------------------------------------ 91 India 234 Nigeria 7 Kazakhastan ....More data So I have to join two tables on the basis of country code and country code can be of 1,2,3,and 4 digits.I have to extract country code from the mobile number write the following logic to join two tables select column1,colum2.... from events e,l_countrycode vcc2 where substring(e.callednumber,1,1)= vcc2.country_code in or substring(e.callednumber,1,2)=vcc2.country_code or substring(e.callednumber,1,3)=vcc2.country_code or substring(e.callednumber,1,4))=vcc2.country_code The preceding code does not run,so I try this select column1,colum2.... from events e,l_countrycode vcc2 where vcc2.country_code in(substring(e.callednumber,1,1),substring(e.callednumber,1,2),substring(e.callednumber,1,3), substring(e.callednumber,1,4)) Both query returns error NotImplementedException: Join between 'e' and 'vcc2' requires at least one conjunctive equality predicate between the two tables. The only option I left with is to use UNION but the table contains millions of data and it will hinder performance and affect memory. So please help me how can I achieve my target without UNION as the above query runs fine in MYSQL
... View more
Labels:
- Labels:
-
Apache Impala