impala: partition key/value or path whitespace - cloudera

I want to be able to store a partition for "United Kingdom". I have a folder with "Country=United Kingdom". If I do
ALTER TABLE countries ADD PARTITION (Country="United Kingdom") LOCATION "/path/Country=United%20Kingdom"
The command does not throw an error, but the data will not be found in the table.
Any advice? Thanks!

Run
Refresh countries
PS
The space in United Kingdom might be causing issue too.

Run INVALIDATE METADATA countries

Related

Grafana maps with rockset and dynamodb

Hy all, i am using grafana with rockset to collect real time series form our dynamodb database, but we have the next problem in the plugin maps.
My data with the next query:
select country,real,_event_time from commons.Players
is
'US' '0.5' '2020-05-27T08:40:51.548000Z',
'UK' '0.2' '2020-05-27T08:40:50.548000Z'
I read that i must pase the country code in the group by:
select
country,sum(real) as total ,_event_time
from commons.Players
group by _event_time,country
but this doesn't work, I select the correct type of location data (countries) but impossible to see anything.
I don't have problem with any kind of graph but in the map is impossible to my to see the information. I have read documentation and really I don't understand the query that i must use in this part to see the data.
Thanks for everything.
You didn't post your panel configuration so it is blind guess. Use query:
SELECT
_event_time AS "time",
country AS "code",
real
FROM commons.Players
and configure Map Data Options->Location Data: countries to "translate" 2 letter country code to map coordinates.

Google Places API: How to go from address to "good" place_id?

On the google places api site, they have an example query that returns a load of detail:
site:
https://developers.google.com/places/web-service/details
query:
https://maps.googleapis.com/maps/api/place/details/json?placeid=ChIJN1t_tDeuEmsRUsoyG83frY4&key=My-API-Key
Place_id appears to be the key here. So I'm trying to reverse-engineer this example, starting from information that a human being would actually have, to end up with this place_id.
Address from the example:
48 Pirrama Rd, Pyrmont NSW 2009, Australia
Places API query from the address:
https://maps.googleapis.com/maps/api/place/textsearch/json?query=48+Pirrama+Rd,+Pyrmont+NSW+2009,+Australia&key=My_API_Key
The result contains a different place_id:
ChIJ8UadyjeuEmsRDt5QbiDg720
And the place details with that place_id are much poorer than the original example:
https://maps.googleapis.com/maps/api/place/details/json?placeid=ChIJ8UadyjeuEmsRDt5QbiDg720&key=My-API-Key
So what am I missing here? How do I start from human-place information and get to the place_id that has the great place details?
EDIT: why the down votes? Am I trying to do something that isn't allowed?
Thanks,
sff
I think your text search is returning the office building, whereas your first search is returning the Google office within the office building. You can fix your text search by adding the name of the company and removing some of the search terms.
I'm not sure why just adding 'google' to the search term doesn't return the result you want though.

Google places api not showing results for some places

Hello i am using simple google map places api to get near by atms for users. My client lives around new york and for some strange reason api shows zero results for that place, but works fine near me (pakistan) . I searched for it a little and found out it was google's issue and some other places were also experiencing the same problem. But i never quite found any solution for this.
This is the get call i use
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=40.7128,74.1059&radius=10000000&keyword=atm&key=MY_KEY
I would really appreciate the help. Thank you :)
Google place nearby search maximum 50,000 meters (31 miles) . if you try enter more than 50,000 it not work proper.
There is another way for find all ATM in a city. google provide Text Search Requests
https://maps.googleapis.com/maps/api/place/textsearch/json?query=atm+in+Reno,NV,89501,USA&key={API_KEY}
query = keyword + in + city Name
for get city name using latitude longitude
http://maps.googleapis.com/maps/api/geocode/json?latlng=39.52963,-119.81380&sensor=true
For more information how to get city name using latitude longitude
https://developers.google.com/maps/documentation/geocoding/start?csw=1#ReverseGeocoding
for more information about how to use Text Search Requests
https://developers.google.com/places/web-service/search
OR (second way)
There is another way for find all ATM in a city.
Open Google Maps .
create 10-12 or more points latitude , longitude value to trigger
request.
Then use a loop to find all places within these points.
If you want more appropriate results, increase first trigger points
for your requests.
- It is just a logic i created in php.
$triggerPoints = array("lat1,long1", "lat2,long2", "lat3,long3",....);
foreeach(triggerPoints as $tP){
$requestUrl = "https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=$tP&radius=[YOUR_RADIUS_VALUE]&type=[YOUR_TYPE]&name=panera&key=[YOUR_KEY_HERE";
$results = file_get_contents($requestUrl);
//Do what you want with response JSON data
}
SHORT ANSWER: Use logical types with your needs.
In my case i used food types instead of supermarket. In some cases, my local market named A101 wasnt found under supermarkets. To find which keywords is best for you, you can search below url with your location and map_key and find most common keywords under types for each query and use it.
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=40.986527896166244,%2029.24326049097467&rankby=distance&keyword=a101&key=YOUR_MAP_KEY

Revive Adserver and Geotargeting by City with GeoLiteCity.dat

I'm trying to set up Geo Targeting for my Revive adserver, but have one question.
I'm using the GeoLite City and GeoLite Country files from Maxmind (the .dat files) and have uploaded them to my server and added them in the Maxmind plugin settings.
So far so good, but:
When I try to Geo Target a banner by City, I first get to choose the country in a drop down list, but then there is only a text field where I add the cities.
Is this the intended behaviour? I thought that there would be a drop down for the cities as well? Or should I write the cities manually? What if there are different ways of spelling a city name for instance?
Any hints?

Sqlite: won't show up multiple results

I've got two tables 1. List of continents 2. Contries belonging to each of 6 continents. In my app I want to show up in table view continent name and countries belonging to this continent. My current select:
SELECT cont.continentID,cont.continentName,cont.continentImage,(select contr.countryName from countries as contr where contr.relativeToContinent=cont.continentID) as 'hash'\
FROM Continents as cont
I frankly to say, was expecting to see the full list of countries because select contr.countryName from countries as contr where contr.relativeToContinent=cont.continentID select, yes, retrieves the full list, but when all the selects are combined together I am getting only first country from list. How to solve this problem? Thank you in advance.
give us a database example (just export all the database with sqlite3 db.sqlite .dump) then we can try it out ourselves. i think it could be done with join or something.

Resources