Sha256: 81d993a78928da86af2de267d6ea51c8e5285a0e8bd018ffa48f5bd2c135a8b1

Contents?: true

Size: 421 Bytes

Versions: 1

Compression:

Stored size: 421 Bytes

Contents

module AmazonAthena
  class Partition

    def initialize(options: {}, location: nil)
      @options = options
      @location = location
    end

    def to_s
      return nil if @options.empty?

      # TODO: Sanitize and handle non-strings
      opts = @options.map {|k,v| "#{k} = '#{v}'"}.join(", ")

      sql = "PARTITION (#{opts})"
      sql += " LOCATION '#{@location}'" if @location

      sql
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
athena-cli-0.1.0 lib/amazon_athena/partition.rb