Exemple #1
0
 def test_cython_bigint_coder(self):
     data = [1, 100, -100, -1000]
     python_field_coders = [
         coder_impl.BigIntCoderImpl() for _ in range(len(data))
     ]
     cython_field_coders = [
         fast_coder_impl.BigIntCoderImpl() for _ in range(len(data))
     ]
     self.check_cython_coder(python_field_coders, cython_field_coders,
                             [data])
Exemple #2
0
 def test_cython_array_coder(self):
     data = [[1, 2, 3, None]]
     python_field_coders = [
         coder_impl.ArrayCoderImpl(coder_impl.BigIntCoderImpl())
         for _ in range(len(data))
     ]
     cython_field_coders = [
         fast_coder_impl.ArrayCoderImpl(fast_coder_impl.BigIntCoderImpl())
         for _ in range(len(data))
     ]
     self.check_cython_coder(python_field_coders, cython_field_coders,
                             [data])
Exemple #3
0
 def test_cython_map_coder(self):
     data = [{'flink': 1, 'pyflink': 2, 'coder': None}]
     python_field_coders = [
         coder_impl.MapCoderImpl(coder_impl.CharCoderImpl(),
                                 coder_impl.BigIntCoderImpl())
         for _ in range(len(data))
     ]
     cython_field_coders = [
         fast_coder_impl.MapCoderImpl(fast_coder_impl.CharCoderImpl(),
                                      fast_coder_impl.BigIntCoderImpl())
         for _ in range(len(data))
     ]
     self.check_cython_coder(python_field_coders, cython_field_coders,
                             [data])
Exemple #4
0
 def test_cython_row_coder(self):
     from pyflink.table import Row
     field_count = 2
     data = [Row(*[None if i % 2 == 0 else i for i in range(field_count)])]
     python_field_coders = [
         coder_impl.RowCoderImpl(
             [coder_impl.BigIntCoderImpl() for _ in range(field_count)])
     ]
     cython_field_coders = [
         fast_coder_impl.RowCoderImpl([
             fast_coder_impl.BigIntCoderImpl() for _ in range(field_count)
         ])
     ]
     self.check_cython_coder(python_field_coders, cython_field_coders,
                             [data])
Exemple #5
0
 def get_impl(self):
     return coder_impl.BigIntCoderImpl()
Exemple #6
0
 def _create_impl(self):
     return coder_impl.BigIntCoderImpl()