pigspec 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a3fb02b1553f14d7aabd0b1d2ca952ab42c849af
4
- data.tar.gz: a856137bce4e3292c4435466a57870e34be8b2f2
3
+ metadata.gz: 9126e0915fc32cf772628e8dc83f21885a5a3bb6
4
+ data.tar.gz: 46aa89aa241e39078f2fa815489dd9c9ecd65b2e
5
5
  SHA512:
6
- metadata.gz: 3a84c9d6b724695026d76c2c90006650b37ea69240a6a381c27df26a2876e8a858a041dd0f02090a7a412ac58b8f1e47c5495c8907c6ced02f9e6c546310b16b
7
- data.tar.gz: f6484d7efe2433ff1e064733cbd60c4ede92d558d4a6ac3c0fca4723d92e4f42b28b9efbed54a408d3c902041bebdd3a5077abe5ce04bc77865a514cf115252d
6
+ metadata.gz: e892a0f60982cfe14f3035bec20d1443fcde361961d711f6ab804e9ee84a4222bf80d31d0f3a29cd8e7589c1626bad4446b5d32509536c36c9707029e5a5e29c
7
+ data.tar.gz: be84544a92c2a194bd237b174df4d03223f22bd41ce1d526db7cd3c52188aea564330a0a0494f852bfeea18c2a507ee648a3895f398cc170abf73c83675822a7
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # PigSpec
2
2
 
3
- PigSpec is a extention for rspec testing framework for Apache Pig.
3
+ PigSpec is an extention for rspec testing framework for Apache Pig.
4
4
  This extention can execute pig script with customize input relation data, and can get output relation data in ruby easily.
5
5
 
6
6
 
@@ -61,7 +61,9 @@ module PigSpec
61
61
  raw_schema = server.dumpSchema(alias_name)
62
62
  builder = @string_builder_class.new
63
63
  @schema_class.stringifySchema(builder, raw_schema, @data_type_enum.TUPLE)
64
- builder.toString
64
+ str_schema = builder.toString
65
+ return nil if str_schema.split("\n").join('') == '()'
66
+ str_schema
65
67
  end
66
68
 
67
69
  def stringify(alias_values)
@@ -1,4 +1,4 @@
1
1
  # PigSpec version constant
2
2
  module PigSpec
3
- VERSION = '0.0.2'
3
+ VERSION = '0.0.3'
4
4
  end
data/lib/pigspec.rb CHANGED
@@ -78,8 +78,9 @@ module PigSpec
78
78
  Test.bridge.upload_text item[:value], temp
79
79
 
80
80
  schema = Test.bridge.schema item[:name]
81
-
82
- query = "#{item[:name]} = LOAD '#{temp}' USING PigStorage('\\t') AS #{schema};"
81
+ query = "#{item[:name]} = LOAD '#{temp}' USING PigStorage('\\t')"
82
+ query += " AS #{schema}" unless schema.nil?
83
+ query += ';'
83
84
  test.override item[:name], query
84
85
  end
85
86
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pigspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - shiracha
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-03 00:00:00.000000000 Z
11
+ date: 2015-07-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rjb
@@ -140,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
140
140
  version: '0'
141
141
  requirements: []
142
142
  rubyforge_project:
143
- rubygems_version: 2.2.2
143
+ rubygems_version: 2.4.6
144
144
  signing_key:
145
145
  specification_version: 4
146
146
  summary: A Testing Framework extension for Apache Pig.