colinmarc / impala-ruby

an impala client for ruby
MIT License
34 stars 22 forks source link

Any plans to support ALTER statement? #11

Closed benner closed 10 years ago

benner commented 10 years ago

I found that I can't use ALTER TABLE

ADD PARTITION statements. Code showed the same.

colinmarc commented 10 years ago

Want to add it here and submit a PR? =)

benner commented 10 years ago

I'm tried. It does not work. I'm not very familiar with trift but strace impala-shell and this gem showed to me shat there is different what we send to server and the error message cames from Impala server: "Error: Error: could not match input" @/usr/local/lib/ruby/gems/1.9.1/gems/impala-0.3.1/lib/impala/protocol/beeswax_service.rb:45:in `recv_executeAndWait': Error: Error: could not match input (Impala::Protocol::Beeswax::BeeswaxException)

colinmarc commented 10 years ago

Oh ok. I'll take a look, thanks!

colinmarc commented 10 years ago

Hm, I'm having trouble reproducing this. Using the example from the impala docs:

[5] pry(main)> impala = Impala.connect => # [6] pry(main)> impala.query "create table part_t (x int) partitioned by (month string)" => [] [7] pry(main)> impala.query "alter table part_t add partition (month='January')" => [] [8] pry(main)> impala.query "describe part_t" => [{:name=>"x", :type=>"int", :comment=>nil}, {:name=>"month", :type=>"string", :comment=>nil}]

It sounds like there might be another issue with your code or with impala, but impala-ruby is definitely passing the command cleanly. I'm going to close this, but feel free to reopen if you have any more information to share!