kou commented on code in PR #34952: URL: https://github.com/apache/arrow/pull/34952#discussion_r1161040527
########## ruby/red-arrow/lib/arrow/slicer.rb: ########## @@ -163,10 +163,30 @@ def reject(&block) RejectCondition.new(@column, block) end + def end_with?(substring, ignore_case: false) + MatchSubstringFamilyCondition.new("ends_with", + @column, substring, ignore_case) + end + + def match_like(pattern, ignore_case: false) Review Comment: ```suggestion def match_like?(pattern, ignore_case: false) ``` ########## ruby/red-arrow/lib/arrow/slicer.rb: ########## @@ -163,10 +163,30 @@ def reject(&block) RejectCondition.new(@column, block) end + def end_with?(substring, ignore_case: false) + MatchSubstringFamilyCondition.new("ends_with", + @column, substring, ignore_case) + end + + def match_like(pattern, ignore_case: false) + MatchSubstringFamilyCondition.new("match_like", + @column, pattern, ignore_case) + end + def match_substring(substring, ignore_case: false) Review Comment: ```suggestion def match_substring?(substring, ignore_case: false) ``` ########## ruby/red-arrow/test/test-slicer.rb: ########## @@ -528,5 +540,40 @@ def setup 2 window TABLE end + + test("match_like") do + sliced_table = @table.slice do |slicer| + slicer.string.match_like("_rr%") + end + assert_equal(<<~TABLE, sliced_table.to_s) + string +0 array +1 Arrow +2 (null) + TABLE + end + + test("match_substring_regex") do + sliced_table = @table.slice do |slicer| + slicer.string.match_substring_regex("[dr]ow") Review Comment: Can we accept `/[dr]ow/` too? If `slicer.string.match_substring_regex(/[dr]ow/)` works, how about adding support for `slicer.string.match_substring(/[dr]ow/)` (== `slicer.string.amtch_substring_regex(/[dr]ow/)`)`? ########## ruby/red-arrow/lib/arrow/slicer.rb: ########## @@ -163,10 +163,30 @@ def reject(&block) RejectCondition.new(@column, block) end + def end_with?(substring, ignore_case: false) + MatchSubstringFamilyCondition.new("ends_with", + @column, substring, ignore_case) + end + + def match_like(pattern, ignore_case: false) + MatchSubstringFamilyCondition.new("match_like", + @column, pattern, ignore_case) + end + def match_substring(substring, ignore_case: false) MatchSubstringFamilyCondition.new("match_substring", @column, substring, ignore_case) end + + def match_substring_regex(pattern, ignore_case: false) Review Comment: ```suggestion def match_substring_regex?(pattern, ignore_case: false) ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org