class AmazonAthena::Commands::AlterTableDropPartition

Public Class Methods

new(database_table, partitions) click to toggle source
# File lib/amazon_athena/commands/alter_table_drop_partition.rb, line 8
def initialize(database_table, partitions)
  @database_table = database_table
  @partitions = partitions
end

Public Instance Methods

partition_clauses() click to toggle source
# File lib/amazon_athena/commands/alter_table_drop_partition.rb, line 13
def partition_clauses
  @partitions.map {|p| "  #{p}"}.join(",\n")
end
run(connection) click to toggle source
# File lib/amazon_athena/commands/alter_table_drop_partition.rb, line 21
def run(connection)
  # TODO: Map fields directly
  connection.query(statement).raw_output
end
statement() click to toggle source
# File lib/amazon_athena/commands/alter_table_drop_partition.rb, line 17
def statement
  "ALTER TABLE #{@database_table} DROP\n#{partition_clauses};"
end