Class: Hivonic::Commands::DropTable

Inherits:
HiveQueryCommand show all
Defined in:
lib/hivonic/commands.rb

Instance Attribute Summary collapse

Attributes inherited from HiveQueryCommand

#db, #hive_opts

Attributes inherited from Subcommand

#dry_run, #exitstatus, #regexp, #subcommand, #time_format, #time_group_index, #ttl

Instance Method Summary collapse

Methods inherited from HiveQueryCommand

#subcommand

Methods inherited from Subcommand

#is_successful?, #output, run, #run, #successful?

Constructor Details

#initialize(opts, args) ⇒ DropTable

Returns a new instance of DropTable.



153
154
155
156
# File 'lib/hivonic/commands.rb', line 153

def initialize(opts, args)
  super
  @table = args[1]
end

Instance Attribute Details

#tableObject (readonly)

Returns the value of attribute table.



151
152
153
# File 'lib/hivonic/commands.rb', line 151

def table
  @table
end

Instance Method Details

#queryObject



158
159
160
# File 'lib/hivonic/commands.rb', line 158

def query
  @query = "DROP TABLE IF EXISTS #{self.db}.#{self.table};"
end