Class: Hivonic::Commands::HiveQueryCommand

Inherits:
Subcommand
  • Object
show all
Defined in:
lib/hivonic/commands.rb

Direct Known Subclasses

CleanupQueryCommand, DropTable, DropView, ListTables

Instance Attribute Summary collapse

Attributes inherited from Subcommand

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

Instance Method Summary collapse

Methods inherited from Subcommand

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

Constructor Details

#initialize(opts, args) ⇒ HiveQueryCommand

Returns a new instance of HiveQueryCommand.



97
98
99
100
101
# File 'lib/hivonic/commands.rb', line 97

def initialize(opts, args)
  super
  @hive_opts = opts['hive-opts']
  @db        = args[0]
end

Instance Attribute Details

#dbObject (readonly)

Returns the value of attribute db.



95
96
97
# File 'lib/hivonic/commands.rb', line 95

def db
  @db
end

#hive_optsObject (readonly)

Returns the value of attribute hive_opts.



94
95
96
# File 'lib/hivonic/commands.rb', line 94

def hive_opts
  @hive_opts
end

Instance Method Details

#queryObject



103
104
105
# File 'lib/hivonic/commands.rb', line 103

def query
  @query = nil
end

#subcommandObject



107
108
109
# File 'lib/hivonic/commands.rb', line 107

def subcommand
  @subcommand = "hive #{self.hive_opts} -e \"#{self.query}\""
end