Class: AmazonAthena::Commands::ShowPartitions
- Inherits:
-
AmazonAthena::Command
- Object
- AmazonAthena::Command
- AmazonAthena::Commands::ShowPartitions
- Defined in:
- lib/amazon_athena/commands/show_partitions.rb
Instance Method Summary collapse
-
#initialize(database_table) ⇒ ShowPartitions
constructor
A new instance of ShowPartitions.
- #run(connection) ⇒ Object
- #statement ⇒ Object
Methods inherited from AmazonAthena::Command
Constructor Details
#initialize(database_table) ⇒ ShowPartitions
Returns a new instance of ShowPartitions.
7 8 9 |
# File 'lib/amazon_athena/commands/show_partitions.rb', line 7 def initialize(database_table) @database_table = database_table end |
Instance Method Details
#run(connection) ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/amazon_athena/commands/show_partitions.rb', line 15 def run(connection) # TODO: Map fields directly connection.query(statement).raw_output rescue Exception => e case e. when /not a partitioned table/ "Error: #{@database_table} is not a partitioned table." end end |
#statement ⇒ Object
11 12 13 |
# File 'lib/amazon_athena/commands/show_partitions.rb', line 11 def statement "SHOW PARTITIONS #{@database_table};" end |