You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -123,53 +123,53 @@ objects. Querying any other data types from Oracle Database will result in an
123
123
exception. :ref:`Output type handlers <outputtypehandlers>` cannot be used to
124
124
map data types.
125
125
126
-
.. list-table-with-summary:: Mapping from Oracle Database to Arrow data types
126
+
.. list-table-with-summary:: Mapping from Oracle Database to Apache Arrow data types
127
127
:header-rows: 1
128
128
:class: wy-table-responsive
129
129
:widths: 1 1
130
130
:width: 100%
131
131
:align: left
132
-
:summary: The first column is the Oracle Database type. The second column is the Arrow data type used in the python-oracledb DataFrame object.
132
+
:summary: The first column is the Oracle Database type. The second column is the Apache Arrow data type used in the python-oracledb DataFrame object.
133
133
134
134
* - Oracle Database Type
135
-
- Arrow Data Type
136
-
* - DB_TYPE_BINARY_DOUBLE
135
+
- Apache Arrow Data Type
136
+
* - :attr:`DB_TYPE_BINARY_DOUBLE`
137
137
- DOUBLE
138
-
* - DB_TYPE_BINARY_FLOAT
138
+
* - :attr:`DB_TYPE_BINARY_FLOAT`
139
139
- FLOAT
140
-
* - DB_TYPE_BLOB
140
+
* - :attr:`DB_TYPE_BLOB`
141
141
- LARGE_BINARY
142
-
* - DB_TYPE_BOOLEAN
142
+
* - :attr:`DB_TYPE_BOOLEAN`
143
143
- BOOLEAN
144
-
* - DB_TYPE_CHAR
145
-
- STRING
146
-
* - DB_TYPE_CLOB
144
+
* - :attr:`DB_TYPE_CHAR`
147
145
- LARGE_STRING
148
-
* - DB_TYPE_DATE
146
+
* - :attr:`DB_TYPE_CLOB`
147
+
- LARGE_STRING
148
+
* - :attr:`DB_TYPE_DATE`
149
149
- TIMESTAMP
150
-
* - DB_TYPE_LONG
150
+
* - :attr:`DB_TYPE_LONG`
151
151
- LARGE_STRING
152
-
* - DB_TYPE_LONG_RAW
152
+
* - :attr:`DB_TYPE_LONG_RAW`
153
153
- LARGE_BINARY
154
-
* - DB_TYPE_NCHAR
155
-
- STRING
156
-
* - DB_TYPE_NCLOB
154
+
* - :attr:`DB_TYPE_NCHAR`
155
+
- LARGE_STRING
156
+
* - :attr:`DB_TYPE_NCLOB`
157
157
- LARGE_STRING
158
-
* - DB_TYPE_NUMBER
158
+
* - :attr:`DB_TYPE_NUMBER`
159
159
- DECIMAL128, INT64, or DOUBLE
160
-
* - DB_TYPE_NVARCHAR
161
-
- STRING
162
-
* - DB_TYPE_RAW
163
-
- BINARY
164
-
* - DB_TYPE_TIMESTAMP
160
+
* - :attr:`DB_TYPE_NVARCHAR`
161
+
- LARGE_STRING
162
+
* - :attr:`DB_TYPE_RAW`
163
+
- LARGE_BINARY
164
+
* - :attr:`DB_TYPE_TIMESTAMP`
165
165
- TIMESTAMP
166
-
* - DB_TYPE_TIMESTAMP_LTZ
166
+
* - :attr:`DB_TYPE_TIMESTAMP_LTZ`
167
167
- TIMESTAMP
168
-
* - DB_TYPE_TIMESTAMP_TZ
168
+
* - :attr:`DB_TYPE_TIMESTAMP_TZ`
169
169
- TIMESTAMP
170
-
* - DB_TYPE_VARCHAR
171
-
- STRING
172
-
* - DB_TYPE_VECTOR
170
+
* - :attr:`DB_TYPE_VARCHAR`
171
+
- LARGE_STRING
172
+
* - :attr:`DB_TYPE_VECTOR`
173
173
- List or struct with DOUBLE, FLOAT, INT8, or UINT8 values
174
174
175
175
**Numbers**
@@ -178,15 +178,25 @@ When converting Oracle Database NUMBERs:
178
178
179
179
- If the column has been created without a precision and scale, or you are
180
180
querying an expression that results in a number without precision or scale,
181
-
then the Arrow data type will be DOUBLE.
181
+
then the Apache Arrow data type will be DOUBLE.
182
182
183
183
- If :attr:`oracledb.defaults.fetch_decimals <Defaults.fetch_decimals>` is set
184
-
to *True*, then the Arrow data type is DECIMAL128.
184
+
to *True*, then the Apache Arrow data type is DECIMAL128.
185
185
186
186
- If the column has been created with a scale of *0*, and a precision value
187
-
that is less than or equal to *18*, then the Arrow data type is INT64.
187
+
that is less than or equal to *18*, then the Apache Arrow data type is INT64.
188
+
189
+
- In all other cases, the Apache Arrow data type is DOUBLE.
190
+
191
+
**Strings**
192
+
193
+
When converting Oracle Database character types:
188
194
189
-
- In all other cases, the Arrow data type is DOUBLE.
195
+
- If the number of records being fetched by :meth:`Connection.fetch_df_all()`,
196
+
or fetched in each batch by :meth:`Connection.fetch_df_batches()`, can be
197
+
handled by 32-bit offsets, you can use an :ref:`explicit mapping
198
+
<explicitmapping>` to fetch as STRING instead of the default
199
+
LARGE_STRING. This will save 4 bytes per record.
190
200
191
201
**Vectors**
192
202
@@ -211,10 +221,10 @@ When converting Oracle Database VECTORs:
211
221
:class: wy-table-responsive
212
222
:widths: 1 1
213
223
:align: left
214
-
:summary: The first column is the Oracle Database VECTOR format. The second column is the resulting Arrow data type in the list.
224
+
:summary: The first column is the Oracle Database VECTOR format. The second column is the resulting Apache Arrow data type in the list.
215
225
216
226
* - Oracle Database VECTOR format
217
-
- Arrow data type
227
+
- Apache Arrow data type
218
228
* - FLOAT64
219
229
- DOUBLE
220
230
* - FLOAT32
@@ -226,33 +236,52 @@ When converting Oracle Database VECTORs:
226
236
227
237
See :ref:`dfvector` for more information.
228
238
229
-
**LOBs**
239
+
**CLOB and NCLOB**
230
240
231
-
When converting Oracle Database CLOBs and BLOBs:
241
+
When converting Oracle Database CLOBs and NCLOBs:
232
242
233
-
- The LOBs must be no more than 1 GB in length.
243
+
- LOBs must be no more than 1 GB in length.
244
+
245
+
- If the number of records being fetched by :meth:`Connection.fetch_df_all()`,
246
+
or fetched in each batch by :meth:`Connection.fetch_df_batches()`, can be
247
+
handled by 32-bit offsets, you can use an :ref:`explicit mapping
248
+
<explicitmapping>` to fetch CLOBs and NCLOBs as STRING instead of the default
249
+
LARGE_STRING. This will save 4 bytes per record.
250
+
251
+
**BLOB**
252
+
253
+
When converting Oracle Database BLOBs:
254
+
255
+
- LOBs must be no more than 1 GB in length.
256
+
257
+
- If the number of records being fetched by :meth:`Connection.fetch_df_all()`,
258
+
or fetched in each batch by :meth:`Connection.fetch_df_batches()`, can be
259
+
handled by 32-bit offsets, you can use an :ref:`explicit mapping
260
+
<explicitmapping>` to fetch BLOBs as BINARY instead of the default
261
+
LARGE_BINARY. This will save 4 bytes per record.
234
262
235
263
**Dates and Timestamps**
236
264
237
265
When converting Oracle Database DATEs and TIMESTAMPs:
238
266
239
-
- Arrow TIMESTAMPs will not have timezone data.
267
+
- Apache Arrow TIMESTAMPs will not have timezone data.
240
268
241
-
- For Oracle Database DATE columns, the Arrow TIMESTAMP will have a time unit
242
-
of "seconds".
269
+
- For Oracle Database DATE columns, the Apache Arrow TIMESTAMP will have a time
270
+
unit of "seconds".
243
271
244
-
- For Oracle Database TIMESTAMP types, the Arrow TIMESTAMP time unit depends on
245
-
the Oracle type's fractional precision as shown in the table below:
272
+
- For Oracle Database TIMESTAMP types, the Apache Arrow TIMESTAMP time unit
273
+
depends on the Oracle type's fractional precision as shown in the table
274
+
below:
246
275
247
276
.. list-table-with-summary::
248
277
:header-rows: 1
249
278
:class: wy-table-responsive
250
279
:widths: 1 1
251
280
:align: left
252
-
:summary: The first column is the Oracle Database TIMESTAMP-type fractional second precision. The second column is the resulting Arrow TIMESTAMP time unit.
281
+
:summary: The first column is the Oracle Database TIMESTAMP-type fractional second precision. The second column is the resulting Apache Arrow TIMESTAMP time unit.
253
282
254
283
* - Oracle Database TIMESTAMP fractional second precision range
255
-
- Arrow TIMESTAMP time unit
284
+
- Apache Arrow TIMESTAMP time unit
256
285
* - 0
257
286
- seconds
258
287
* - 1 - 3
@@ -262,6 +291,8 @@ When converting Oracle Database DATEs and TIMESTAMPs:
262
291
* - 7 - 9
263
292
- nanoseconds
264
293
294
+
.. _explicitmapping:
295
+
265
296
Explicit Data Frame Type Mapping
266
297
++++++++++++++++++++++++++++++++
267
298
@@ -338,22 +369,50 @@ requested schema type.
338
369
:class: wy-table-responsive
339
370
:widths: 1 1
340
371
:align: left
341
-
:summary: The first column is the Oracle Database data type. The second column shows supported Arrow data types.
372
+
:summary: The first column is the Oracle Database data type. The second column shows supported Apache Arrow data types.
0 commit comments