Sha256: e3347129267d7f667cfb2dee9510d29f4ce279d7077b2fdb63922eb9e04557b4

Contents?: true

Size: 614 Bytes

Versions: 48

Compression:

Stored size: 614 Bytes

Contents

require 'helper'
require 'time'
require 'embulk/guess/schema_guess'

class SchemaGuessTest < ::Test::Unit::TestCase
  G = Embulk::Guess::SchemaGuess
  C = Embulk::Column

  def test_guess
    G.from_hash_records([{"int" => "1", "str" => "a"}])
  end

  def test_coalesce
    assert_equal(
      [C.new(0, "a", :timestamp, "%Y%m%d")],
      G.from_hash_records([
        {"a" => "20160101"},
        {"a" => "20160101"},
      ]))

    assert_equal(
      [C.new(0, "a", :long)],
      G.from_hash_records([
        {"a" => "20160101"},
        {"a" => "20160101"},
        {"a" => "12345678"},
      ]))
  end
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
embulk-0.8.35 test/guess/test_schema_guess.rb
embulk-0.8.35-java test/guess/test_schema_guess.rb
embulk-0.8.34 test/guess/test_schema_guess.rb
embulk-0.8.34-java test/guess/test_schema_guess.rb
embulk-0.8.33 test/guess/test_schema_guess.rb
embulk-0.8.33-java test/guess/test_schema_guess.rb
embulk-0.8.32 test/guess/test_schema_guess.rb
embulk-0.8.32-java test/guess/test_schema_guess.rb
embulk-0.8.31 test/guess/test_schema_guess.rb
embulk-0.8.31-java test/guess/test_schema_guess.rb
embulk-0.8.30 test/guess/test_schema_guess.rb
embulk-0.8.30-java test/guess/test_schema_guess.rb
embulk-0.8.29 test/guess/test_schema_guess.rb
embulk-0.8.29-java test/guess/test_schema_guess.rb
embulk-0.8.28 test/guess/test_schema_guess.rb
embulk-0.8.28-java test/guess/test_schema_guess.rb
embulk-0.8.27 test/guess/test_schema_guess.rb
embulk-0.8.27-java test/guess/test_schema_guess.rb
embulk-0.8.26 test/guess/test_schema_guess.rb
embulk-0.8.26-java test/guess/test_schema_guess.rb