Generated by Cython 3.1.4
Yellow lines hint at Python interaction.
Click on a line that starts with a "+" to see the C code that Cython generated for it.
Raw output: decoder_fast.c
+001: # Licensed to the Apache Software Foundation (ASF) under one
__pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_4) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
002: # or more contributor license agreements. See the NOTICE file
003: # distributed with this work for additional information
004: # regarding copyright ownership. The ASF licenses this file
005: # to you under the Apache License, Version 2.0 (the
006: # "License"); you may not use this file except in compliance
007: # with the License. You may obtain a copy of the License at
008: #
009: # http://www.apache.org/licenses/LICENSE-2.0
010: #
011: # Unless required by applicable law or agreed to in writing,
012: # software distributed under the License is distributed on an
013: # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
014: # KIND, either express or implied. See the License for the
015: # specific language governing permissions and limitations
016: # under the License.
017: import cython
018: from cython.cimports.cpython import array
+019: from pyiceberg.avro import STRUCT_DOUBLE, STRUCT_FLOAT
__pyx_t_2 = __Pyx_PyList_Pack(2, __pyx_mstate_global->__pyx_n_u_STRUCT_DOUBLE, __pyx_mstate_global->__pyx_n_u_STRUCT_FLOAT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_pyiceberg_avro, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_STRUCT_DOUBLE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_STRUCT_DOUBLE, __pyx_t_2) < 0) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_STRUCT_FLOAT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_STRUCT_FLOAT, __pyx_t_2) < 0) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
020: from cpython.mem cimport PyMem_Malloc, PyMem_Realloc, PyMem_Free
021: from libc.string cimport memcpy
022: from libc.stdint cimport uint64_t, int64_t
023:
+024: import array
__pyx_t_3 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_array, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_array, __pyx_t_3) < 0) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
025:
026:
027: cdef extern from "decoder_basic.c":
028: void decode_zigzag_ints(const unsigned char **buffer, const uint64_t count, uint64_t *result);
029: void skip_zigzag_int(const unsigned char **buffer);
030:
+031: unsigned_long_long_array_template = cython.declare(array.array, array.array('Q', []))
__pyx_t_2 = NULL; __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_7cpython_5array_array); __pyx_t_4 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_7cpython_5array_array); __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = 1; { PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Q, __pyx_t_5}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error) __Pyx_GOTREF((PyObject *)__pyx_t_3); } __Pyx_XGOTREF((PyObject *)__pyx_v_9pyiceberg_4avro_12decoder_fast_unsigned_long_long_array_template); __Pyx_DECREF_SET(__pyx_v_9pyiceberg_4avro_12decoder_fast_unsigned_long_long_array_template, ((arrayobject *)__pyx_t_3)); __Pyx_GIVEREF((PyObject *)__pyx_t_3); __pyx_t_3 = 0;
032:
+033: @cython.final
struct __pyx_obj_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder {
PyObject_HEAD
struct __pyx_vtabstruct_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder *__pyx_vtab;
unsigned char *_data;
unsigned char const *_current;
unsigned char const *_end;
uint64_t _size;
};
struct __pyx_vtabstruct_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder {
unsigned int (*tell)(struct __pyx_obj_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder *, int __pyx_skip_dispatch);
PyObject *(*read)(struct __pyx_obj_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder *, PyObject *, int __pyx_skip_dispatch);
int64_t (*read_int)(struct __pyx_obj_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder *, int __pyx_skip_dispatch);
void (*read_int_bytes_dict)(struct __pyx_obj_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder *, PyObject *, PyObject *, int __pyx_skip_dispatch);
PyObject *(*read_bytes)(struct __pyx_obj_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder *, int __pyx_skip_dispatch);
float (*read_float)(struct __pyx_obj_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder *, int __pyx_skip_dispatch);
float (*read_double)(struct __pyx_obj_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder *, int __pyx_skip_dispatch);
PyObject *(*read_utf8)(struct __pyx_obj_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder *__pyx_vtabptr_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder;
034: cdef class CythonBinaryDecoder:
035: """Implement a BinaryDecoder that reads from an in-memory buffer."""
036:
037: # This the data that is duplicated when the decoder is created.
038: cdef unsigned char *_data
039:
040: # This is the current pointer to the buffer.
041: cdef const unsigned char *_current
042:
043: # This is the address after the data buffer
044: cdef const unsigned char *_end
045:
046: # This is the size of the buffer of the data being parsed.
047: cdef uint64_t _size
048:
+049: def __cinit__(self, input_contents: bytes) -> None:
/* Python wrapper */
static int __pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_input_contents = 0;
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
#endif
__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
{
PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_input_contents,0};
PyObject* values[1] = {0};
const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 49, __pyx_L3_error)
if (__pyx_kwds_len > 0) {
switch (__pyx_nargs) {
case 1:
values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 49, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
const Py_ssize_t kwd_pos_args = __pyx_nargs;
if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__cinit__", 0) < 0) __PYX_ERR(0, 49, __pyx_L3_error)
for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, i); __PYX_ERR(0, 49, __pyx_L3_error) }
}
} else if (unlikely(__pyx_nargs != 1)) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 49, __pyx_L3_error)
}
__pyx_v_input_contents = ((PyObject*)values[0]);
}
goto __pyx_L6_skip;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 49, __pyx_L3_error)
__pyx_L6_skip:;
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__Pyx_AddTraceback("pyiceberg.avro.decoder_fast.CythonBinaryDecoder.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input_contents), (&PyBytes_Type), 0, "input_contents", 2))) __PYX_ERR(0, 49, __pyx_L1_error)
__pyx_r = __pyx_pf_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder___cinit__(((struct __pyx_obj_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder *)__pyx_v_self), __pyx_v_input_contents);
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = -1;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
goto __pyx_L7_cleaned_up;
__pyx_L0:;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__pyx_L7_cleaned_up:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder___cinit__(struct __pyx_obj_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder *__pyx_v_self, PyObject *__pyx_v_input_contents) {
unsigned char const *__pyx_v_input_as_array;
int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("pyiceberg.avro.decoder_fast.CythonBinaryDecoder.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
return __pyx_r;
}
+050: self._size = len(input_contents)
__pyx_t_1 = __Pyx_PyBytes_GET_SIZE(__pyx_v_input_contents); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 50, __pyx_L1_error) __pyx_v_self->_size = __pyx_t_1;
051:
052: # Make a copy of the data so the data can be iterated.
+053: self._data = <unsigned char *> PyMem_Malloc(self._size * sizeof(char))
__pyx_v_self->_data = ((unsigned char *)PyMem_Malloc((__pyx_v_self->_size * (sizeof(char)))));
+054: if not self._data:
__pyx_t_2 = (!(__pyx_v_self->_data != 0));
if (unlikely(__pyx_t_2)) {
/* … */
}
+055: raise MemoryError()
PyErr_NoMemory(); __PYX_ERR(0, 55, __pyx_L1_error)
+056: cdef const unsigned char *input_as_array = input_contents
__pyx_t_3 = __Pyx_PyBytes_AsUString(__pyx_v_input_contents); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L1_error) __pyx_v_input_as_array = __pyx_t_3;
+057: memcpy(self._data, input_as_array, self._size)
(void)(memcpy(__pyx_v_self->_data, __pyx_v_input_as_array, __pyx_v_self->_size));
+058: self._end = self._data + self._size
__pyx_v_self->_end = (__pyx_v_self->_data + __pyx_v_self->_size);
+059: self._current = self._data
__pyx_t_4 = __pyx_v_self->_data; __pyx_v_self->_current = __pyx_t_4;
060:
+061: def __dealloc__(self):
/* Python wrapper */
static void __pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_3__dealloc__(PyObject *__pyx_v_self) {
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
__pyx_pf_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_2__dealloc__(((struct __pyx_obj_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
}
static void __pyx_pf_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_2__dealloc__(struct __pyx_obj_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder *__pyx_v_self) {
/* … */
/* function exit code */
}
+062: PyMem_Free(self._data)
PyMem_Free(__pyx_v_self->_data);
063:
+064: cpdef unsigned int tell(self):
static PyObject *__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_5tell(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static unsigned int __pyx_f_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_tell(struct __pyx_obj_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder *__pyx_v_self, CYTHON_UNUSED int __pyx_skip_dispatch) {
unsigned int __pyx_r;
/* … */
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_5tell(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_4tell, "Return the current stream position.");
static PyMethodDef __pyx_mdef_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_5tell = {"tell", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_5tell, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_4tell};
static PyObject *__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_5tell(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
#if !CYTHON_METH_FASTCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("tell (wrapper)", 0);
#if !CYTHON_METH_FASTCALL
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
#endif
#endif
__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("tell", 1, 0, 0, __pyx_nargs); return NULL; }
const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len < 0)) return NULL;
if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("tell", __pyx_kwds); return NULL;}
__pyx_r = __pyx_pf_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_4tell(((struct __pyx_obj_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_4tell(struct __pyx_obj_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __pyx_f_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_tell(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 64, __pyx_L1_error)
__pyx_t_2 = __Pyx_PyLong_From_unsigned_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("pyiceberg.avro.decoder_fast.CythonBinaryDecoder.tell", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* … */
__pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_5tell, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CythonBinaryDecoder_tell, NULL, __pyx_mstate_global->__pyx_n_u_pyiceberg_avro_decoder_fast, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 64, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder, __pyx_mstate_global->__pyx_n_u_tell, __pyx_t_3) < 0) __PYX_ERR(0, 64, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
065: """Return the current stream position."""
+066: return self._current - self._data
__pyx_r = (__pyx_v_self->_current - __pyx_v_self->_data); goto __pyx_L0;
067:
+068: cpdef bytes read(self, n: int):
static PyObject *__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_7read(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_f_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_read(struct __pyx_obj_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder *__pyx_v_self, PyObject *__pyx_v_n, CYTHON_UNUSED int __pyx_skip_dispatch) {
unsigned char const *__pyx_v_r;
PyObject *__pyx_r = NULL;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_AddTraceback("pyiceberg.avro.decoder_fast.CythonBinaryDecoder.read", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_7read(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_6read, "Read n bytes.");
static PyMethodDef __pyx_mdef_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_7read = {"read", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_7read, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_6read};
static PyObject *__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_7read(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
PyObject *__pyx_v_n = 0;
#if !CYTHON_METH_FASTCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("read (wrapper)", 0);
#if !CYTHON_METH_FASTCALL
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
#endif
#endif
__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
{
PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_n,0};
PyObject* values[1] = {0};
const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 68, __pyx_L3_error)
if (__pyx_kwds_len > 0) {
switch (__pyx_nargs) {
case 1:
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 68, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
const Py_ssize_t kwd_pos_args = __pyx_nargs;
if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "read", 0) < 0) __PYX_ERR(0, 68, __pyx_L3_error)
for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("read", 1, 1, 1, i); __PYX_ERR(0, 68, __pyx_L3_error) }
}
} else if (unlikely(__pyx_nargs != 1)) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 68, __pyx_L3_error)
}
__pyx_v_n = ((PyObject*)values[0]);
}
goto __pyx_L6_skip;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("read", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 68, __pyx_L3_error)
__pyx_L6_skip:;
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__Pyx_AddTraceback("pyiceberg.avro.decoder_fast.CythonBinaryDecoder.read", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_n), (&PyLong_Type), 0, "n", 2))) __PYX_ERR(0, 68, __pyx_L1_error)
__pyx_r = __pyx_pf_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_6read(((struct __pyx_obj_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder *)__pyx_v_self), __pyx_v_n);
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
goto __pyx_L7_cleaned_up;
__pyx_L0:;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__pyx_L7_cleaned_up:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_6read(struct __pyx_obj_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder *__pyx_v_self, PyObject *__pyx_v_n) {
PyObject *__pyx_r = NULL;
__Pyx_XDECREF(__pyx_r);
if (unlikely(__pyx_v_n == Py_None)) {
PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
__PYX_ERR(0, 68, __pyx_L1_error)
}
__pyx_t_1 = __pyx_f_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_read(__pyx_v_self, __pyx_v_n, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("pyiceberg.avro.decoder_fast.CythonBinaryDecoder.read", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* … */
__pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 68, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_n, __pyx_mstate_global->__pyx_n_u_int) < 0) __PYX_ERR(0, 68, __pyx_L1_error)
__pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_7read, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CythonBinaryDecoder_read, NULL, __pyx_mstate_global->__pyx_n_u_pyiceberg_avro_decoder_fast, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 68, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_3);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder, __pyx_mstate_global->__pyx_n_u_read, __pyx_t_4) < 0) __PYX_ERR(0, 68, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
069: """Read n bytes."""
+070: if n < 0:
__pyx_t_1 = PyObject_RichCompare(__pyx_v_n, __pyx_mstate_global->__pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_t_2)) { /* … */ }
+071: raise ValueError(f"Requested {n} bytes to read, expected positive integer.")
__pyx_t_3 = NULL;
__Pyx_INCREF(__pyx_builtin_ValueError);
__pyx_t_4 = __pyx_builtin_ValueError;
__pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_n, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 71, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6[0] = __pyx_mstate_global->__pyx_kp_u_Requested;
__pyx_t_6[1] = __pyx_t_5;
__pyx_t_6[2] = __pyx_mstate_global->__pyx_kp_u_bytes_to_read_expected_positive;
__pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_6, 3, 10 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + 42, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5));
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 71, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_8 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_7};
__pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
}
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__PYX_ERR(0, 71, __pyx_L1_error)
+072: cdef const unsigned char *r = self._current
__pyx_t_9 = __pyx_v_self->_current; __pyx_v_r = __pyx_t_9;
+073: self._current += n
__pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 73, __pyx_L1_error) __pyx_v_self->_current = (__pyx_v_self->_current + __pyx_t_10);
+074: return r[0:n]
__Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_n); __pyx_t_11 = __pyx_v_n; __pyx_t_2 = (__pyx_t_11 == ((PyObject*)Py_None)); if (__pyx_t_2) { __pyx_t_10 = PY_SSIZE_T_MAX; } else { __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_11); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 74, __pyx_L1_error) __pyx_t_10 = __pyx_t_12; } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(((char const *)__pyx_v_r) + 0, __pyx_t_10 - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0;
075:
+076: def read_boolean(self) -> bool:
/* Python wrapper */ static PyObject *__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_9read_boolean(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_8read_boolean, "Reads a value from the stream as a boolean.\n\n A boolean is written as a single byte\n whose value is either 0 (false) or 1 (true).\n "); static PyMethodDef __pyx_mdef_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_9read_boolean = {"read_boolean", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_9read_boolean, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_8read_boolean}; static PyObject *__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_9read_boolean(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("read_boolean (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("read_boolean", 1, 0, 0, __pyx_nargs); return NULL; } const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return NULL; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("read_boolean", __pyx_kwds); return NULL;} __pyx_r = __pyx_pf_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_8read_boolean(((struct __pyx_obj_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_8read_boolean(struct __pyx_obj_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder *__pyx_v_self) { PyObject *__pyx_r = NULL; /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pyiceberg.avro.decoder_fast.CythonBinaryDecoder.read_boolean", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < 0) __PYX_ERR(0, 76, __pyx_L1_error) __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_9read_boolean, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CythonBinaryDecoder_read_boolean, NULL, __pyx_mstate_global->__pyx_n_u_pyiceberg_avro_decoder_fast, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder, __pyx_mstate_global->__pyx_n_u_read_boolean, __pyx_t_3) < 0) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
077: """Reads a value from the stream as a boolean.
078:
079: A boolean is written as a single byte
080: whose value is either 0 (false) or 1 (true).
081: """
+082: self._current += 1;
__pyx_v_self->_current = (__pyx_v_self->_current + 1);
+083: return self._current[-1] != 0
__Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong(((__pyx_v_self->_current[-1L]) != 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0;
084:
+085: cpdef inline int64_t read_int(self):
static PyObject *__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_11read_int(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static CYTHON_INLINE int64_t __pyx_f_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_read_int(struct __pyx_obj_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder *__pyx_v_self, CYTHON_UNUSED int __pyx_skip_dispatch) {
uint64_t __pyx_v_result;
int64_t __pyx_r;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("pyiceberg.avro.decoder_fast.CythonBinaryDecoder.read_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_11read_int(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_10read_int, "Reads a value from the stream as an integer.\n\n int/long values are written using variable-length, zigzag coding.\n ");
static PyMethodDef __pyx_mdef_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_11read_int = {"read_int", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_11read_int, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_10read_int};
static PyObject *__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_11read_int(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
#if !CYTHON_METH_FASTCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("read_int (wrapper)", 0);
#if !CYTHON_METH_FASTCALL
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
#endif
#endif
__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("read_int", 1, 0, 0, __pyx_nargs); return NULL; }
const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len < 0)) return NULL;
if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("read_int", __pyx_kwds); return NULL;}
__pyx_r = __pyx_pf_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_10read_int(((struct __pyx_obj_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_10read_int(struct __pyx_obj_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __pyx_f_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_read_int(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 85, __pyx_L1_error)
__pyx_t_2 = __Pyx_PyLong_From_int64_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("pyiceberg.avro.decoder_fast.CythonBinaryDecoder.read_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* … */
__pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_11read_int, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CythonBinaryDecoder_read_int, NULL, __pyx_mstate_global->__pyx_n_u_pyiceberg_avro_decoder_fast, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[3])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder, __pyx_mstate_global->__pyx_n_u_read_int, __pyx_t_3) < 0) __PYX_ERR(0, 85, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
086: """Reads a value from the stream as an integer.
087:
088: int/long values are written using variable-length, zigzag coding.
089: """
090: cdef uint64_t result;
+091: if self._current >= self._end:
__pyx_t_1 = (__pyx_v_self->_current >= __pyx_v_self->_end);
if (unlikely(__pyx_t_1)) {
/* … */
}
+092: raise EOFError(f"EOF: read 1 bytes")
__pyx_t_3 = NULL;
__Pyx_INCREF(__pyx_builtin_EOFError);
__pyx_t_4 = __pyx_builtin_EOFError;
__pyx_t_5 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_EOF_read_1_bytes};
__pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__PYX_ERR(0, 92, __pyx_L1_error)
+093: decode_zigzag_ints(&self._current, 1, &result)
decode_zigzag_ints((&__pyx_v_self->_current), 1, (&__pyx_v_result));
+094: return result
__pyx_r = __pyx_v_result; goto __pyx_L0;
095:
+096: def read_ints(self, count: int) -> array.array[int]:
/* Python wrapper */ static PyObject *__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_13read_ints(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_12read_ints, "Reads a list of integers."); static PyMethodDef __pyx_mdef_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_13read_ints = {"read_ints", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_13read_ints, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_12read_ints}; static PyObject *__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_13read_ints(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_count = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("read_ints (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_count,0}; PyObject* values[1] = {0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 96, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 96, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "read_ints", 0) < 0) __PYX_ERR(0, 96, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("read_ints", 1, 1, 1, i); __PYX_ERR(0, 96, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 96, __pyx_L3_error) } __pyx_v_count = ((PyObject*)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("read_ints", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 96, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(values[__pyx_temp]); } __Pyx_AddTraceback("pyiceberg.avro.decoder_fast.CythonBinaryDecoder.read_ints", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_count), (&PyLong_Type), 0, "count", 2))) __PYX_ERR(0, 96, __pyx_L1_error) __pyx_r = __pyx_pf_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_12read_ints(((struct __pyx_obj_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder *)__pyx_v_self), __pyx_v_count); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(values[__pyx_temp]); } goto __pyx_L7_cleaned_up; __pyx_L0:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(values[__pyx_temp]); } __pyx_L7_cleaned_up:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_12read_ints(struct __pyx_obj_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder *__pyx_v_self, PyObject *__pyx_v_count) { arrayobject *__pyx_v_newarray = NULL; PyObject *__pyx_r = NULL; /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pyiceberg.avro.decoder_fast.CythonBinaryDecoder.read_ints", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_newarray); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_count, __pyx_mstate_global->__pyx_n_u_int) < 0) __PYX_ERR(0, 96, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_array_array_int) < 0) __PYX_ERR(0, 96, __pyx_L1_error) __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_13read_ints, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CythonBinaryDecoder_read_ints, NULL, __pyx_mstate_global->__pyx_n_u_pyiceberg_avro_decoder_fast, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[4])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder, __pyx_mstate_global->__pyx_n_u_read_ints, __pyx_t_4) < 0) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
097: """Reads a list of integers."""
+098: newarray = array.clone(unsigned_long_long_array_template, count, zero=False)
__pyx_t_1 = ((PyObject *)__pyx_v_9pyiceberg_4avro_12decoder_fast_unsigned_long_long_array_template); __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_v_count); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_f_7cpython_5array_clone(((arrayobject *)__pyx_t_1), __pyx_t_2, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_newarray = ((arrayobject *)__pyx_t_3); __pyx_t_3 = 0;
+099: if self._current >= self._end:
__pyx_t_4 = (__pyx_v_self->_current >= __pyx_v_self->_end);
if (unlikely(__pyx_t_4)) {
/* … */
}
+100: raise EOFError(f"EOF: read 1 bytes")
__pyx_t_1 = NULL;
__Pyx_INCREF(__pyx_builtin_EOFError);
__pyx_t_5 = __pyx_builtin_EOFError;
__pyx_t_6 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_EOF_read_1_bytes};
__pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 100, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
}
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__PYX_ERR(0, 100, __pyx_L1_error)
+101: decode_zigzag_ints(&self._current, count, <uint64_t *>newarray.data.as_ulonglongs)
__pyx_t_7 = __Pyx_PyLong_As_uint64_t(__pyx_v_count); if (unlikely((__pyx_t_7 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 101, __pyx_L1_error) decode_zigzag_ints((&__pyx_v_self->_current), __pyx_t_7, ((uint64_t *)__pyx_v_newarray->data.as_ulonglongs));
+102: return newarray
__Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_newarray); __pyx_r = ((PyObject *)__pyx_v_newarray); goto __pyx_L0;
103:
+104: cpdef void read_int_bytes_dict(self, count: int, dest: Dict[int, bytes]):
static PyObject *__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_15read_int_bytes_dict(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_read_int_bytes_dict(struct __pyx_obj_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder *__pyx_v_self, PyObject *__pyx_v_count, PyObject *__pyx_v_dest, CYTHON_UNUSED int __pyx_skip_dispatch) {
uint64_t __pyx_v_result[2];
CYTHON_UNUSED PyObject *__pyx_v__ = NULL;
/* … */
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("pyiceberg.avro.decoder_fast.CythonBinaryDecoder.read_int_bytes_dict", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_L0:;
__Pyx_XDECREF(__pyx_v__);
__Pyx_RefNannyFinishContext();
}
/* Python wrapper */
static PyObject *__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_15read_int_bytes_dict(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_14read_int_bytes_dict, "Reads a dictionary of integers for keys and bytes for values into a destination dict.");
static PyMethodDef __pyx_mdef_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_15read_int_bytes_dict = {"read_int_bytes_dict", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_15read_int_bytes_dict, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_14read_int_bytes_dict};
static PyObject *__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_15read_int_bytes_dict(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
PyObject *__pyx_v_count = 0;
PyObject *__pyx_v_dest = 0;
#if !CYTHON_METH_FASTCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("read_int_bytes_dict (wrapper)", 0);
#if !CYTHON_METH_FASTCALL
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
#endif
#endif
__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
{
PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_count,&__pyx_mstate_global->__pyx_n_u_dest,0};
PyObject* values[2] = {0,0};
const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 104, __pyx_L3_error)
if (__pyx_kwds_len > 0) {
switch (__pyx_nargs) {
case 2:
values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 104, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 1:
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 104, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
const Py_ssize_t kwd_pos_args = __pyx_nargs;
if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "read_int_bytes_dict", 0) < 0) __PYX_ERR(0, 104, __pyx_L3_error)
for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("read_int_bytes_dict", 1, 2, 2, i); __PYX_ERR(0, 104, __pyx_L3_error) }
}
} else if (unlikely(__pyx_nargs != 2)) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 104, __pyx_L3_error)
values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 104, __pyx_L3_error)
}
__pyx_v_count = ((PyObject*)values[0]);
__pyx_v_dest = values[1];
}
goto __pyx_L6_skip;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("read_int_bytes_dict", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 104, __pyx_L3_error)
__pyx_L6_skip:;
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__Pyx_AddTraceback("pyiceberg.avro.decoder_fast.CythonBinaryDecoder.read_int_bytes_dict", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_count), (&PyLong_Type), 0, "count", 2))) __PYX_ERR(0, 104, __pyx_L1_error)
__pyx_r = __pyx_pf_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_14read_int_bytes_dict(((struct __pyx_obj_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder *)__pyx_v_self), __pyx_v_count, __pyx_v_dest);
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
goto __pyx_L7_cleaned_up;
__pyx_L0:;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__pyx_L7_cleaned_up:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_14read_int_bytes_dict(struct __pyx_obj_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder *__pyx_v_self, PyObject *__pyx_v_count, PyObject *__pyx_v_dest) {
PyObject *__pyx_r = NULL;
__Pyx_XDECREF(__pyx_r);
if (unlikely(__pyx_v_count == Py_None)) {
PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
__PYX_ERR(0, 104, __pyx_L1_error)
}
__pyx_f_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_read_int_bytes_dict(__pyx_v_self, __pyx_v_count, __pyx_v_dest, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L1_error)
__pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("pyiceberg.avro.decoder_fast.CythonBinaryDecoder.read_int_bytes_dict", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* … */
__pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 104, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_count, __pyx_mstate_global->__pyx_n_u_int) < 0) __PYX_ERR(0, 104, __pyx_L1_error)
if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_dest, __pyx_mstate_global->__pyx_kp_u_Dict_int_bytes) < 0) __PYX_ERR(0, 104, __pyx_L1_error)
__pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_15read_int_bytes_dict, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CythonBinaryDecoder_read_int_byt, NULL, __pyx_mstate_global->__pyx_n_u_pyiceberg_avro_decoder_fast, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[5])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 104, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder, __pyx_mstate_global->__pyx_n_u_read_int_bytes_dict, __pyx_t_3) < 0) __PYX_ERR(0, 104, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
105: """Reads a dictionary of integers for keys and bytes for values into a destination dict."""
106: cdef uint64_t result[2];
+107: if self._current >= self._end:
__pyx_t_1 = (__pyx_v_self->_current >= __pyx_v_self->_end);
if (unlikely(__pyx_t_1)) {
/* … */
}
+108: raise EOFError(f"EOF: read 1 bytes")
__pyx_t_3 = NULL;
__Pyx_INCREF(__pyx_builtin_EOFError);
__pyx_t_4 = __pyx_builtin_EOFError;
__pyx_t_5 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_EOF_read_1_bytes};
__pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 108, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__PYX_ERR(0, 108, __pyx_L1_error)
109:
+110: for _ in range(count):
__pyx_t_4 = NULL; __Pyx_INCREF(__pyx_builtin_range); __pyx_t_3 = __pyx_builtin_range; __pyx_t_5 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_count}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 110, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (likely(!__pyx_t_7)) { if (likely(PyList_CheckExact(__pyx_t_3))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 110, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_6); ++__pyx_t_6; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 110, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6)); #else __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_6); #endif ++__pyx_t_6; } if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error) } else { __pyx_t_2 = __pyx_t_7(__pyx_t_3); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 110, __pyx_L1_error) PyErr_Clear(); } break; } } __Pyx_GOTREF(__pyx_t_2); if (!(likely(PyLong_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_2))) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v__, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; /* … */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+111: decode_zigzag_ints(&self._current, 2, <uint64_t *>&result)
decode_zigzag_ints((&__pyx_v_self->_current), 2, ((uint64_t *)(&__pyx_v_result)));
+112: if result[1] <= 0:
__pyx_t_1 = ((__pyx_v_result[1]) <= 0);
if (__pyx_t_1) {
/* … */
goto __pyx_L6;
}
+113: dest[result[0]] = b""
if (unlikely((__Pyx_SetItemInt(__pyx_v_dest, (__pyx_v_result[0]), __pyx_mstate_global->__pyx_kp_b_, uint64_t, 0, __Pyx_PyLong_From_uint64_t, 0, 0, 1, 1) < 0))) __PYX_ERR(0, 113, __pyx_L1_error)
114: else:
+115: dest[result[0]] = self._current[0:result[1]]
/*else*/ {
__pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(((char const *)__pyx_v_self->_current) + 0, (__pyx_v_result[1]) - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 115, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
if (unlikely((__Pyx_SetItemInt(__pyx_v_dest, (__pyx_v_result[0]), __pyx_t_2, uint64_t, 0, __Pyx_PyLong_From_uint64_t, 0, 0, 1, 1) < 0))) __PYX_ERR(0, 115, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+116: self._current += result[1]
__pyx_v_self->_current = (__pyx_v_self->_current + (__pyx_v_result[1]));
}
__pyx_L6:;
117:
+118: cpdef inline bytes read_bytes(self):
static PyObject *__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_17read_bytes(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_read_bytes(struct __pyx_obj_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder *__pyx_v_self, CYTHON_UNUSED int __pyx_skip_dispatch) {
uint64_t __pyx_v_length;
unsigned char const *__pyx_v_r;
PyObject *__pyx_r = NULL;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("pyiceberg.avro.decoder_fast.CythonBinaryDecoder.read_bytes", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_17read_bytes(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_16read_bytes, "Bytes are encoded as a long followed by that many bytes of data.");
static PyMethodDef __pyx_mdef_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_17read_bytes = {"read_bytes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_17read_bytes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_16read_bytes};
static PyObject *__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_17read_bytes(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
#if !CYTHON_METH_FASTCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("read_bytes (wrapper)", 0);
#if !CYTHON_METH_FASTCALL
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
#endif
#endif
__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("read_bytes", 1, 0, 0, __pyx_nargs); return NULL; }
const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len < 0)) return NULL;
if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("read_bytes", __pyx_kwds); return NULL;}
__pyx_r = __pyx_pf_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_16read_bytes(((struct __pyx_obj_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_16read_bytes(struct __pyx_obj_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __pyx_f_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_read_bytes(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("pyiceberg.avro.decoder_fast.CythonBinaryDecoder.read_bytes", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* … */
__pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_17read_bytes, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CythonBinaryDecoder_read_bytes, NULL, __pyx_mstate_global->__pyx_n_u_pyiceberg_avro_decoder_fast, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[6])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 118, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder, __pyx_mstate_global->__pyx_n_u_read_bytes, __pyx_t_3) < 0) __PYX_ERR(0, 118, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
119: """Bytes are encoded as a long followed by that many bytes of data."""
120: cdef uint64_t length;
+121: if self._current >= self._end:
__pyx_t_1 = (__pyx_v_self->_current >= __pyx_v_self->_end);
if (unlikely(__pyx_t_1)) {
/* … */
}
+122: raise EOFError(f"EOF: read 1 bytes")
__pyx_t_3 = NULL;
__Pyx_INCREF(__pyx_builtin_EOFError);
__pyx_t_4 = __pyx_builtin_EOFError;
__pyx_t_5 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_EOF_read_1_bytes};
__pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__PYX_ERR(0, 122, __pyx_L1_error)
123:
+124: decode_zigzag_ints(&self._current, 1, &length)
decode_zigzag_ints((&__pyx_v_self->_current), 1, (&__pyx_v_length));
125:
+126: if length <= 0:
__pyx_t_1 = (__pyx_v_length <= 0);
if (__pyx_t_1) {
/* … */
}
+127: return b""
__Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_b_); __pyx_r = __pyx_mstate_global->__pyx_kp_b_; goto __pyx_L0;
+128: cdef const unsigned char *r = self._current
__pyx_t_6 = __pyx_v_self->_current; __pyx_v_r = __pyx_t_6;
+129: self._current += length
__pyx_v_self->_current = (__pyx_v_self->_current + __pyx_v_length);
+130: return r[0:length]
__Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(((char const *)__pyx_v_r) + 0, __pyx_v_length - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0;
131:
+132: cpdef float read_float(self):
static PyObject *__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_19read_float(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static float __pyx_f_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_read_float(struct __pyx_obj_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder *__pyx_v_self, CYTHON_UNUSED int __pyx_skip_dispatch) {
float __pyx_r;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("pyiceberg.avro.decoder_fast.CythonBinaryDecoder.read_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_19read_float(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_18read_float, "Reads a value from the stream as a float.\n\n A float is written as 4 bytes.\n The float is converted into a 32-bit integer using a method equivalent to\n Java's floatToIntBits and then encoded in little-endian format.\n ");
static PyMethodDef __pyx_mdef_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_19read_float = {"read_float", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_19read_float, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_18read_float};
static PyObject *__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_19read_float(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
#if !CYTHON_METH_FASTCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("read_float (wrapper)", 0);
#if !CYTHON_METH_FASTCALL
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
#endif
#endif
__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("read_float", 1, 0, 0, __pyx_nargs); return NULL; }
const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len < 0)) return NULL;
if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("read_float", __pyx_kwds); return NULL;}
__pyx_r = __pyx_pf_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_18read_float(((struct __pyx_obj_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_18read_float(struct __pyx_obj_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __pyx_f_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_read_float(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error)
__pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 132, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("pyiceberg.avro.decoder_fast.CythonBinaryDecoder.read_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* … */
__pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_19read_float, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CythonBinaryDecoder_read_float, NULL, __pyx_mstate_global->__pyx_n_u_pyiceberg_avro_decoder_fast, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[7])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 132, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder, __pyx_mstate_global->__pyx_n_u_read_float, __pyx_t_3) < 0) __PYX_ERR(0, 132, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
133: """Reads a value from the stream as a float.
134:
135: A float is written as 4 bytes.
136: The float is converted into a 32-bit integer using a method equivalent to
137: Java's floatToIntBits and then encoded in little-endian format.
138: """
+139: return float(STRUCT_FLOAT.unpack(self.read(4))[0])
__pyx_t_2 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_STRUCT_FLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_unpack); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __pyx_f_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_read(__pyx_v_self, __pyx_mstate_global->__pyx_int_4, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); assert(__pyx_t_2); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_5 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyObject_AsDouble(__pyx_t_4); if (unlikely(__pyx_t_6 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_6; goto __pyx_L0;
140:
+141: cpdef float read_double(self):
static PyObject *__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_21read_double(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static float __pyx_f_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_read_double(struct __pyx_obj_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder *__pyx_v_self, CYTHON_UNUSED int __pyx_skip_dispatch) {
float __pyx_r;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("pyiceberg.avro.decoder_fast.CythonBinaryDecoder.read_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_21read_double(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_20read_double, "Reads a value from the stream as a double.\n\n A double is written as 8 bytes.\n The double is converted into a 64-bit integer using a method equivalent to\n Java's doubleToLongBits and then encoded in little-endian format.\n ");
static PyMethodDef __pyx_mdef_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_21read_double = {"read_double", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_21read_double, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_20read_double};
static PyObject *__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_21read_double(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
#if !CYTHON_METH_FASTCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("read_double (wrapper)", 0);
#if !CYTHON_METH_FASTCALL
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
#endif
#endif
__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("read_double", 1, 0, 0, __pyx_nargs); return NULL; }
const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len < 0)) return NULL;
if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("read_double", __pyx_kwds); return NULL;}
__pyx_r = __pyx_pf_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_20read_double(((struct __pyx_obj_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_20read_double(struct __pyx_obj_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __pyx_f_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_read_double(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 141, __pyx_L1_error)
__pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("pyiceberg.avro.decoder_fast.CythonBinaryDecoder.read_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* … */
__pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_21read_double, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CythonBinaryDecoder_read_double, NULL, __pyx_mstate_global->__pyx_n_u_pyiceberg_avro_decoder_fast, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[8])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 141, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder, __pyx_mstate_global->__pyx_n_u_read_double, __pyx_t_3) < 0) __PYX_ERR(0, 141, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
142: """Reads a value from the stream as a double.
143:
144: A double is written as 8 bytes.
145: The double is converted into a 64-bit integer using a method equivalent to
146: Java's doubleToLongBits and then encoded in little-endian format.
147: """
+148: return float(STRUCT_DOUBLE.unpack(self.read(8))[0])
__pyx_t_2 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_STRUCT_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_unpack); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __pyx_f_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_read(__pyx_v_self, __pyx_mstate_global->__pyx_int_8, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); assert(__pyx_t_2); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_5 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyObject_AsDouble(__pyx_t_4); if (unlikely(__pyx_t_6 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_6; goto __pyx_L0;
149:
+150: cpdef str read_utf8(self):
static PyObject *__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_23read_utf8(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_f_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_read_utf8(struct __pyx_obj_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder *__pyx_v_self, CYTHON_UNUSED int __pyx_skip_dispatch) {
PyObject *__pyx_r = NULL;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("pyiceberg.avro.decoder_fast.CythonBinaryDecoder.read_utf8", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_23read_utf8(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_22read_utf8, "Reads a utf-8 encoded string from the stream.\n\n A string is encoded as a long followed by\n that many bytes of UTF-8 encoded character data.\n ");
static PyMethodDef __pyx_mdef_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_23read_utf8 = {"read_utf8", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_23read_utf8, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_22read_utf8};
static PyObject *__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_23read_utf8(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
#if !CYTHON_METH_FASTCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("read_utf8 (wrapper)", 0);
#if !CYTHON_METH_FASTCALL
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
#endif
#endif
__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("read_utf8", 1, 0, 0, __pyx_nargs); return NULL; }
const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len < 0)) return NULL;
if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("read_utf8", __pyx_kwds); return NULL;}
__pyx_r = __pyx_pf_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_22read_utf8(((struct __pyx_obj_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_22read_utf8(struct __pyx_obj_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __pyx_f_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_read_utf8(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 150, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("pyiceberg.avro.decoder_fast.CythonBinaryDecoder.read_utf8", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* … */
__pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_23read_utf8, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CythonBinaryDecoder_read_utf8, NULL, __pyx_mstate_global->__pyx_n_u_pyiceberg_avro_decoder_fast, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[9])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 150, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder, __pyx_mstate_global->__pyx_n_u_read_utf8, __pyx_t_3) < 0) __PYX_ERR(0, 150, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
151: """Reads a utf-8 encoded string from the stream.
152:
153: A string is encoded as a long followed by
154: that many bytes of UTF-8 encoded character data.
155: """
+156: return self.read_bytes().decode("utf-8")
__Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_read_bytes(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_t_1 == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode"); __PYX_ERR(0, 156, __pyx_L1_error) } __pyx_t_2 = __Pyx_decode_bytes(__pyx_t_1, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0;
157:
+158: def skip_int(self) -> None:
/* Python wrapper */
static PyObject *__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_25skip_int(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_25skip_int = {"skip_int", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_25skip_int, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_25skip_int(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
#if !CYTHON_METH_FASTCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("skip_int (wrapper)", 0);
#if !CYTHON_METH_FASTCALL
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
#endif
#endif
__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("skip_int", 1, 0, 0, __pyx_nargs); return NULL; }
const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len < 0)) return NULL;
if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("skip_int", __pyx_kwds); return NULL;}
__pyx_r = __pyx_pf_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_24skip_int(((struct __pyx_obj_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_24skip_int(struct __pyx_obj_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder *__pyx_v_self) {
PyObject *__pyx_r = NULL;
/* … */
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* … */
__pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < 0) __PYX_ERR(0, 158, __pyx_L1_error)
__pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_25skip_int, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CythonBinaryDecoder_skip_int, NULL, __pyx_mstate_global->__pyx_n_u_pyiceberg_avro_decoder_fast, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[10])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 158, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_3);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder, __pyx_mstate_global->__pyx_n_u_skip_int, __pyx_t_4) < 0) __PYX_ERR(0, 158, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+159: skip_zigzag_int(&self._current)
skip_zigzag_int((&__pyx_v_self->_current));
+160: return
__Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0;
161:
+162: def skip(self, n: int) -> None:
/* Python wrapper */
static PyObject *__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_27skip(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_27skip = {"skip", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_27skip, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_27skip(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
PyObject *__pyx_v_n = 0;
#if !CYTHON_METH_FASTCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("skip (wrapper)", 0);
#if !CYTHON_METH_FASTCALL
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
#endif
#endif
__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
{
PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_n,0};
PyObject* values[1] = {0};
const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 162, __pyx_L3_error)
if (__pyx_kwds_len > 0) {
switch (__pyx_nargs) {
case 1:
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 162, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
const Py_ssize_t kwd_pos_args = __pyx_nargs;
if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "skip", 0) < 0) __PYX_ERR(0, 162, __pyx_L3_error)
for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("skip", 1, 1, 1, i); __PYX_ERR(0, 162, __pyx_L3_error) }
}
} else if (unlikely(__pyx_nargs != 1)) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 162, __pyx_L3_error)
}
__pyx_v_n = ((PyObject*)values[0]);
}
goto __pyx_L6_skip;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("skip", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 162, __pyx_L3_error)
__pyx_L6_skip:;
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__Pyx_AddTraceback("pyiceberg.avro.decoder_fast.CythonBinaryDecoder.skip", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_n), (&PyLong_Type), 0, "n", 2))) __PYX_ERR(0, 162, __pyx_L1_error)
__pyx_r = __pyx_pf_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_26skip(((struct __pyx_obj_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder *)__pyx_v_self), __pyx_v_n);
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
goto __pyx_L7_cleaned_up;
__pyx_L0:;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__pyx_L7_cleaned_up:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_26skip(struct __pyx_obj_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder *__pyx_v_self, PyObject *__pyx_v_n) {
PyObject *__pyx_r = NULL;
/* … */
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("pyiceberg.avro.decoder_fast.CythonBinaryDecoder.skip", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* … */
__pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 162, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_n, __pyx_mstate_global->__pyx_n_u_int) < 0) __PYX_ERR(0, 162, __pyx_L1_error)
if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < 0) __PYX_ERR(0, 162, __pyx_L1_error)
__pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_27skip, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CythonBinaryDecoder_skip, NULL, __pyx_mstate_global->__pyx_n_u_pyiceberg_avro_decoder_fast, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[11])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 162, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder, __pyx_mstate_global->__pyx_n_u_skip, __pyx_t_3) < 0) __PYX_ERR(0, 162, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+163: self._current += n
__pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 163, __pyx_L1_error) __pyx_v_self->_current = (__pyx_v_self->_current + __pyx_t_1);
164:
+165: def skip_boolean(self) -> None:
/* Python wrapper */
static PyObject *__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_29skip_boolean(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_29skip_boolean = {"skip_boolean", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_29skip_boolean, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_29skip_boolean(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
#if !CYTHON_METH_FASTCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("skip_boolean (wrapper)", 0);
#if !CYTHON_METH_FASTCALL
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
#endif
#endif
__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("skip_boolean", 1, 0, 0, __pyx_nargs); return NULL; }
const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len < 0)) return NULL;
if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("skip_boolean", __pyx_kwds); return NULL;}
__pyx_r = __pyx_pf_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_28skip_boolean(((struct __pyx_obj_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_28skip_boolean(struct __pyx_obj_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder *__pyx_v_self) {
PyObject *__pyx_r = NULL;
/* … */
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* … */
__pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < 0) __PYX_ERR(0, 165, __pyx_L1_error)
__pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_29skip_boolean, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CythonBinaryDecoder_skip_boolean, NULL, __pyx_mstate_global->__pyx_n_u_pyiceberg_avro_decoder_fast, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[12])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_3);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder, __pyx_mstate_global->__pyx_n_u_skip_boolean, __pyx_t_4) < 0) __PYX_ERR(0, 165, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+166: self._current += 1
__pyx_v_self->_current = (__pyx_v_self->_current + 1);
167:
+168: def skip_float(self) -> None:
/* Python wrapper */
static PyObject *__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_31skip_float(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_31skip_float = {"skip_float", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_31skip_float, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_31skip_float(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
#if !CYTHON_METH_FASTCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("skip_float (wrapper)", 0);
#if !CYTHON_METH_FASTCALL
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
#endif
#endif
__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("skip_float", 1, 0, 0, __pyx_nargs); return NULL; }
const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len < 0)) return NULL;
if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("skip_float", __pyx_kwds); return NULL;}
__pyx_r = __pyx_pf_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_30skip_float(((struct __pyx_obj_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_30skip_float(struct __pyx_obj_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder *__pyx_v_self) {
PyObject *__pyx_r = NULL;
/* … */
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* … */
__pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 168, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < 0) __PYX_ERR(0, 168, __pyx_L1_error)
__pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_31skip_float, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CythonBinaryDecoder_skip_float, NULL, __pyx_mstate_global->__pyx_n_u_pyiceberg_avro_decoder_fast, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[13])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 168, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder, __pyx_mstate_global->__pyx_n_u_skip_float, __pyx_t_3) < 0) __PYX_ERR(0, 168, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+169: self._current += 4
__pyx_v_self->_current = (__pyx_v_self->_current + 4);
170:
+171: def skip_double(self) -> None:
/* Python wrapper */
static PyObject *__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_33skip_double(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_33skip_double = {"skip_double", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_33skip_double, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_33skip_double(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
#if !CYTHON_METH_FASTCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("skip_double (wrapper)", 0);
#if !CYTHON_METH_FASTCALL
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
#endif
#endif
__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("skip_double", 1, 0, 0, __pyx_nargs); return NULL; }
const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len < 0)) return NULL;
if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("skip_double", __pyx_kwds); return NULL;}
__pyx_r = __pyx_pf_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_32skip_double(((struct __pyx_obj_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_32skip_double(struct __pyx_obj_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder *__pyx_v_self) {
PyObject *__pyx_r = NULL;
/* … */
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* … */
__pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 171, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < 0) __PYX_ERR(0, 171, __pyx_L1_error)
__pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_33skip_double, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CythonBinaryDecoder_skip_double, NULL, __pyx_mstate_global->__pyx_n_u_pyiceberg_avro_decoder_fast, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[14])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 171, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_3);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder, __pyx_mstate_global->__pyx_n_u_skip_double, __pyx_t_4) < 0) __PYX_ERR(0, 171, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+172: self._current += 8
__pyx_v_self->_current = (__pyx_v_self->_current + 8);
173:
+174: def skip_bytes(self) -> None:
/* Python wrapper */
static PyObject *__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_35skip_bytes(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_35skip_bytes = {"skip_bytes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_35skip_bytes, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_35skip_bytes(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
#if !CYTHON_METH_FASTCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("skip_bytes (wrapper)", 0);
#if !CYTHON_METH_FASTCALL
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
#endif
#endif
__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("skip_bytes", 1, 0, 0, __pyx_nargs); return NULL; }
const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len < 0)) return NULL;
if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("skip_bytes", __pyx_kwds); return NULL;}
__pyx_r = __pyx_pf_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_34skip_bytes(((struct __pyx_obj_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_34skip_bytes(struct __pyx_obj_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder *__pyx_v_self) {
uint64_t __pyx_v_result;
PyObject *__pyx_r = NULL;
/* … */
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* … */
__pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 174, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < 0) __PYX_ERR(0, 174, __pyx_L1_error)
__pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_35skip_bytes, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CythonBinaryDecoder_skip_bytes, NULL, __pyx_mstate_global->__pyx_n_u_pyiceberg_avro_decoder_fast, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[15])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 174, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder, __pyx_mstate_global->__pyx_n_u_skip_bytes, __pyx_t_3) < 0) __PYX_ERR(0, 174, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
175: cdef uint64_t result;
+176: decode_zigzag_ints(&self._current, 1, &result)
decode_zigzag_ints((&__pyx_v_self->_current), 1, (&__pyx_v_result));
+177: self._current += result
__pyx_v_self->_current = (__pyx_v_self->_current + __pyx_v_result);
178:
+179: def skip_utf8(self) -> None:
/* Python wrapper */
static PyObject *__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_37skip_utf8(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_37skip_utf8 = {"skip_utf8", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_37skip_utf8, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_37skip_utf8(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
#if !CYTHON_METH_FASTCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("skip_utf8 (wrapper)", 0);
#if !CYTHON_METH_FASTCALL
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
#endif
#endif
__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("skip_utf8", 1, 0, 0, __pyx_nargs); return NULL; }
const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len < 0)) return NULL;
if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("skip_utf8", __pyx_kwds); return NULL;}
__pyx_r = __pyx_pf_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_36skip_utf8(((struct __pyx_obj_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_36skip_utf8(struct __pyx_obj_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder *__pyx_v_self) {
PyObject *__pyx_r = NULL;
/* … */
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("pyiceberg.avro.decoder_fast.CythonBinaryDecoder.skip_utf8", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* … */
__pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 179, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < 0) __PYX_ERR(0, 179, __pyx_L1_error)
__pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9pyiceberg_4avro_12decoder_fast_19CythonBinaryDecoder_37skip_utf8, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CythonBinaryDecoder_skip_utf8, NULL, __pyx_mstate_global->__pyx_n_u_pyiceberg_avro_decoder_fast, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[16])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 179, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_3);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pyiceberg_4avro_12decoder_fast_CythonBinaryDecoder, __pyx_mstate_global->__pyx_n_u_skip_utf8, __pyx_t_4) < 0) __PYX_ERR(0, 179, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+180: self.skip_bytes()
__pyx_t_2 = ((PyObject *)__pyx_v_self); __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_skip_bytes, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;