0

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!

mad
  • 3,493
  • 4
  • 23
  • 31

2 Answers2

1

Run

Refresh countries 

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

morfious902002
  • 916
  • 1
  • 11
  • 29
  • The space seems to be the problem. Is there any way to have paths with whitespace as impala partitions? – mad Jun 26 '17 at 10:43
  • I looked into a few more docs and they all suggest use of underscore instead of space. – morfious902002 Jun 30 '17 at 01:34
  • thanks. That's what I figured, sadly. Problem is that I use an automated process that creates folders by countries' names, i.e. United Kingdom will be "/path/to/partition/folder/United Kingdom". My workaround was to replace whitespace with underscore in the countries names to generate paths without whitespace and replace those underscores with whitespace for the partition names when altering the impala table/adding the partition. Thanks. – mad Jun 30 '17 at 13:47
0

Run INVALIDATE METADATA countries

Philippe Paulos
  • 352
  • 1
  • 5
  • 14