Skip to content

feat: add support for utf8view type #225

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Arrow.dom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export {
Bool,
Int, Int8, Int16, Int32, Int64, Uint8, Uint16, Uint32, Uint64,
Float, Float16, Float32, Float64,
Utf8, LargeUtf8,
Utf8, Utf8View, LargeUtf8,
Binary, LargeBinary,
FixedSizeBinary,
Date_, DateDay, DateMillisecond,
Expand Down Expand Up @@ -97,5 +97,5 @@ export {
TimestampBuilder, TimestampSecondBuilder, TimestampMillisecondBuilder, TimestampMicrosecondBuilder, TimestampNanosecondBuilder,
TimeBuilder, TimeSecondBuilder, TimeMillisecondBuilder, TimeMicrosecondBuilder, TimeNanosecondBuilder,
UnionBuilder, DenseUnionBuilder, SparseUnionBuilder,
Utf8Builder, LargeUtf8Builder
Utf8Builder, Utf8ViewBuilder, LargeUtf8Builder
} from './Arrow.js';
3 changes: 2 additions & 1 deletion src/Arrow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export {
Bool,
Int, Int8, Int16, Int32, Int64, Uint8, Uint16, Uint32, Uint64,
Float, Float16, Float32, Float64,
Utf8, LargeUtf8,
Utf8, Utf8View, LargeUtf8,
Binary, LargeBinary,
FixedSizeBinary,
Date_, DateDay, DateMillisecond,
Expand Down Expand Up @@ -78,6 +78,7 @@ export { TimestampBuilder, TimestampSecondBuilder, TimestampMillisecondBuilder,
export { IntervalBuilder, IntervalDayTimeBuilder, IntervalYearMonthBuilder, IntervalMonthDayNanoBuilder } from './builder/interval.js';
export { DurationBuilder, DurationSecondBuilder, DurationMillisecondBuilder, DurationMicrosecondBuilder, DurationNanosecondBuilder } from './builder/duration.js';
export { Utf8Builder } from './builder/utf8.js';
export { Utf8ViewBuilder } from './builder/utf8view.js';
export { LargeUtf8Builder } from './builder/largeutf8.js';
export { BinaryBuilder } from './builder/binary.js';
export { LargeBinaryBuilder } from './builder/largebinary.js';
Expand Down
4 changes: 2 additions & 2 deletions src/builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
DataType, strideForType,
Float, Int, Decimal, FixedSizeBinary,
Date_, Time, Timestamp, Interval, Duration,
Utf8, LargeUtf8, Binary, LargeBinary, List, Map_,
Utf8, Utf8View, LargeUtf8, Binary, LargeBinary, List, Map_,
} from './type.js';
import { createIsValidFunction } from './builder/valid.js';
import { BufferBuilder, BitmapBufferBuilder, DataBufferBuilder, OffsetsBufferBuilder } from './builder/buffer.js';
Expand Down Expand Up @@ -357,7 +357,7 @@ export abstract class FixedWidthBuilder<T extends Int | Float | FixedSizeBinary
}

/** @ignore */
export abstract class VariableWidthBuilder<T extends Binary | LargeBinary | Utf8 | LargeUtf8 | List | Map_, TNull = any> extends Builder<T, TNull> {
export abstract class VariableWidthBuilder<T extends Binary | LargeBinary | Utf8 | Utf8View | LargeUtf8 | List | Map_, TNull = any> extends Builder<T, TNull> {
protected _pendingLength = 0;
protected _offsets: OffsetsBufferBuilder<T>;
protected _pending: Map<number, any> | undefined;
Expand Down
44 changes: 44 additions & 0 deletions src/builder/utf8view.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

import { Utf8View } from '../type.js';
import { encodeUtf8 } from '../util/utf8.js';
import { BinaryBuilder } from './binary.js';
import { BufferBuilder } from './buffer.js';
import { VariableWidthBuilder, BuilderOptions } from '../builder.js';

/** @ignore */
export class Utf8ViewBuilder<TNull = any> extends VariableWidthBuilder<Utf8View, TNull> {
constructor(opts: BuilderOptions<Utf8View, TNull>) {
super(opts);
this._values = new BufferBuilder(Uint8Array);
}
public get byteLength(): number {
let size = this._pendingLength + (this.length * 4);
this._offsets && (size += this._offsets.byteLength);
this._values && (size += this._values.byteLength);
this._nulls && (size += this._nulls.byteLength);
return size;
}
public setValue(index: number, value: string) {
return super.setValue(index, encodeUtf8(value) as any);
}
Copy link
Preview

Copilot AI Aug 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The @ts-ignore comment suppresses TypeScript errors without explanation. This makes it difficult to understand what error is being suppressed and why it's safe to ignore.

Suggested change
}
}
// TypeScript cannot track that we are intentionally overriding this method by direct prototype assignment below.
// It reports a type error because the method is replaced at runtime. This is safe because the assigned method is compatible.

Copilot uses AI. Check for mistakes.

// @ts-ignore
protected _flushPending(pending: Map<number, Uint8Array | undefined>, pendingLength: number): void { }
}

(Utf8ViewBuilder.prototype as any)._flushPending = (BinaryBuilder.prototype as any)._flushPending;
Comment on lines +40 to +44
Copy link
Preview

Copilot AI Aug 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using prototype copying with type assertions to share implementation between builders is fragile and makes the code harder to maintain. Consider using composition or inheritance instead of prototype manipulation.

Suggested change
// @ts-ignore
protected _flushPending(pending: Map<number, Uint8Array | undefined>, pendingLength: number): void { }
}
(Utf8ViewBuilder.prototype as any)._flushPending = (BinaryBuilder.prototype as any)._flushPending;
protected _flushPending(pending: Map<number, Uint8Array | undefined>, pendingLength: number): void {
// Delegate to BinaryBuilder's _flushPending implementation using composition
// This assumes BinaryBuilder's _flushPending is compatible and does not rely on internal state
// If not, copy the logic here or extract to a shared helper function
(BinaryBuilder.prototype as any)._flushPending.call(this, pending, pendingLength);
}
}

Copilot uses AI. Check for mistakes.

13 changes: 12 additions & 1 deletion src/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ export class Data<T extends DataType = DataType> {

import {
Dictionary,
Bool, Null, Utf8, LargeUtf8, Binary, LargeBinary, Decimal, FixedSizeBinary, List, FixedSizeList, Map_, Struct,
Bool, Null, Utf8, Utf8View, LargeUtf8, Binary, LargeBinary, Decimal, FixedSizeBinary, List, FixedSizeList, Map_, Struct,
Float,
Int,
Date_,
Expand Down Expand Up @@ -311,6 +311,14 @@ class MakeDataVisitor extends Visitor {
const { ['length']: length = valueOffsets.length - 1, ['nullCount']: nullCount = props['nullBitmap'] ? -1 : 0 } = props;
return new Data(type, offset, length, nullCount, [valueOffsets, data, nullBitmap]);
}
public visitUtf8View<T extends Utf8View>(props: Utf8ViewDataProps<T>) {
const { ['type']: type, ['offset']: offset = 0 } = props;
const data = toUint8Array(props['data']);
const nullBitmap = toUint8Array(props['nullBitmap']);
const valueOffsets = toInt32Array(props['valueOffsets']);
const { ['length']: length = valueOffsets.length - 1, ['nullCount']: nullCount = props['nullBitmap'] ? -1 : 0 } = props;
return new Data(type, offset, length, nullCount, [valueOffsets, data, nullBitmap]);
}
public visitLargeUtf8<T extends LargeUtf8>(props: LargeUtf8DataProps<T>) {
const { ['type']: type, ['offset']: offset = 0 } = props;
const data = toUint8Array(props['data']);
Expand Down Expand Up @@ -457,6 +465,7 @@ interface FixedSizeBinaryDataProps<T extends FixedSizeBinary> extends DataProps_
interface BinaryDataProps<T extends Binary> extends DataProps_<T> { valueOffsets: ValueOffsetsBuffer; data?: DataBuffer<T> }
interface LargeBinaryDataProps<T extends LargeBinary> extends DataProps_<T> { valueOffsets: LargeValueOffsetsBuffer | ValueOffsetsBuffer; data?: DataBuffer<T> }
interface Utf8DataProps<T extends Utf8> extends DataProps_<T> { valueOffsets: ValueOffsetsBuffer; data?: DataBuffer<T> }
interface Utf8ViewDataProps<T extends Utf8View> extends DataProps_<T> { valueOffsets: ValueOffsetsBuffer; data?: DataBuffer<T> }
interface LargeUtf8DataProps<T extends LargeUtf8> extends DataProps_<T> { valueOffsets: LargeValueOffsetsBuffer | ValueOffsetsBuffer; data?: DataBuffer<T> }
interface ListDataProps<T extends List> extends DataProps_<T> { valueOffsets: ValueOffsetsBuffer; child: Data<T['valueType']> }
interface FixedSizeListDataProps<T extends FixedSizeList> extends DataProps_<T> { child: Data<T['valueType']> }
Expand All @@ -482,6 +491,7 @@ export type DataProps<T extends DataType> = (
T extends Binary /* */ ? BinaryDataProps<T> :
T extends LargeBinary /* */ ? LargeBinaryDataProps<T> :
T extends Utf8 /* */ ? Utf8DataProps<T> :
T extends Utf8View /* */ ? Utf8ViewDataProps<T> :
T extends LargeUtf8 /* */ ? LargeUtf8DataProps<T> :
T extends List /* */ ? ListDataProps<T> :
T extends FixedSizeList /* */ ? FixedSizeListDataProps<T> :
Expand Down Expand Up @@ -510,6 +520,7 @@ export function makeData<T extends FixedSizeBinary>(props: FixedSizeBinaryDataPr
export function makeData<T extends Binary>(props: BinaryDataProps<T>): Data<T>;
export function makeData<T extends LargeBinary>(props: LargeBinaryDataProps<T>): Data<T>;
export function makeData<T extends Utf8>(props: Utf8DataProps<T>): Data<T>;
export function makeData<T extends Utf8View>(props: Utf8ViewDataProps<T>): Data<T>;
export function makeData<T extends LargeUtf8>(props: LargeUtf8DataProps<T>): Data<T>;
export function makeData<T extends List>(props: ListDataProps<T>): Data<T>;
export function makeData<T extends FixedSizeList>(props: FixedSizeListDataProps<T>): Data<T>;
Expand Down
1 change: 1 addition & 0 deletions src/enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export enum Type {
Duration = 18, /** Measure of elapsed time in either seconds, milliseconds, microseconds or nanoseconds */
LargeBinary = 19, /** Large variable-length bytes (no guarantee of UTF8-ness) */
LargeUtf8 = 20, /** Large variable-length string as List<Char> */
Utf8View = 24, /** Like Utf8 but may point to one of potentially several data buffers or may contain the characters inline **/

Dictionary = -1, /** Dictionary aka Category type */
Int8 = -2,
Expand Down
1 change: 1 addition & 0 deletions src/factories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export function makeBuilder<T extends dtypes.DataType = any, TNull = any>(option
export function vectorFromArray(values: readonly (null | undefined)[], type?: dtypes.Null): Vector<dtypes.Null>;
export function vectorFromArray(values: readonly (null | undefined | boolean)[], type?: dtypes.Bool): Vector<dtypes.Bool>;
export function vectorFromArray<T extends dtypes.Utf8 | dtypes.Dictionary<dtypes.Utf8> = dtypes.Dictionary<dtypes.Utf8, dtypes.Int32>>(values: readonly (null | undefined | string)[], type?: T): Vector<T>;
export function vectorFromArray<T extends dtypes.Utf8View | dtypes.Dictionary<dtypes.Utf8View> = dtypes.Dictionary<dtypes.Utf8View, dtypes.Int32>>(values: readonly (null | undefined | string)[], type?: T): Vector<T>;
export function vectorFromArray<T extends dtypes.TimestampMillisecond>(values: readonly (null | undefined | Date)[], type?: T): Vector<T>;
export function vectorFromArray<T extends dtypes.Int>(values: readonly (null | undefined | number)[], type: T): Vector<T>;
export function vectorFromArray<T extends dtypes.Int64 | dtypes.Uint64 = dtypes.Int64>(values: readonly (null | undefined | bigint)[], type?: T): Vector<T>;
Expand Down
1 change: 1 addition & 0 deletions src/fb/Schema_generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@ export { Type, unionToType, unionListToType } from './type.js';
export { Union } from './union.js';
export { UnionMode } from './union-mode.js';
export { Utf8 } from './utf8.js';
export { Utf8View } from './utf8-view.js';
14 changes: 9 additions & 5 deletions src/fb/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { Time } from './time.js';
import { Timestamp } from './timestamp.js';
import { Union } from './union.js';
import { Utf8 } from './utf8.js';
import { Utf8View } from './utf8-view.js';


/**
Expand Down Expand Up @@ -52,13 +53,14 @@ export enum Type {
LargeBinary = 19,
LargeUtf8 = 20,
LargeList = 21,
RunEndEncoded = 22
RunEndEncoded = 22,
Utf8View = 24
}

export function unionToType(
type: Type,
accessor: (obj:Binary|Bool|Date|Decimal|Duration|FixedSizeBinary|FixedSizeList|FloatingPoint|Int|Interval|LargeBinary|LargeList|LargeUtf8|List|Map|Null|RunEndEncoded|Struct_|Time|Timestamp|Union|Utf8) => Binary|Bool|Date|Decimal|Duration|FixedSizeBinary|FixedSizeList|FloatingPoint|Int|Interval|LargeBinary|LargeList|LargeUtf8|List|Map|Null|RunEndEncoded|Struct_|Time|Timestamp|Union|Utf8|null
): Binary|Bool|Date|Decimal|Duration|FixedSizeBinary|FixedSizeList|FloatingPoint|Int|Interval|LargeBinary|LargeList|LargeUtf8|List|Map|Null|RunEndEncoded|Struct_|Time|Timestamp|Union|Utf8|null {
accessor: (obj:Binary|Bool|Date|Decimal|Duration|FixedSizeBinary|FixedSizeList|FloatingPoint|Int|Interval|LargeBinary|LargeList|LargeUtf8|List|Map|Null|RunEndEncoded|Struct_|Time|Timestamp|Union|Utf8|Utf8View) => Binary|Bool|Date|Decimal|Duration|FixedSizeBinary|FixedSizeList|FloatingPoint|Int|Interval|LargeBinary|LargeList|LargeUtf8|List|Map|Null|RunEndEncoded|Struct_|Time|Timestamp|Union|Utf8|Utf8View|null
): Binary|Bool|Date|Decimal|Duration|FixedSizeBinary|FixedSizeList|FloatingPoint|Int|Interval|LargeBinary|LargeList|LargeUtf8|List|Map|Null|RunEndEncoded|Struct_|Time|Timestamp|Union|Utf8|Utf8View|null {
switch(Type[type]) {
case 'NONE': return null;
case 'Null': return accessor(new Null())! as Null;
Expand All @@ -83,15 +85,16 @@ export function unionToType(
case 'LargeUtf8': return accessor(new LargeUtf8())! as LargeUtf8;
case 'LargeList': return accessor(new LargeList())! as LargeList;
case 'RunEndEncoded': return accessor(new RunEndEncoded())! as RunEndEncoded;
case 'Utf8View': return accessor(new Utf8View())! as Utf8View;
default: return null;
}
}

export function unionListToType(
type: Type,
accessor: (index: number, obj:Binary|Bool|Date|Decimal|Duration|FixedSizeBinary|FixedSizeList|FloatingPoint|Int|Interval|LargeBinary|LargeList|LargeUtf8|List|Map|Null|RunEndEncoded|Struct_|Time|Timestamp|Union|Utf8) => Binary|Bool|Date|Decimal|Duration|FixedSizeBinary|FixedSizeList|FloatingPoint|Int|Interval|LargeBinary|LargeList|LargeUtf8|List|Map|Null|RunEndEncoded|Struct_|Time|Timestamp|Union|Utf8|null,
accessor: (index: number, obj:Binary|Bool|Date|Decimal|Duration|FixedSizeBinary|FixedSizeList|FloatingPoint|Int|Interval|LargeBinary|LargeList|LargeUtf8|List|Map|Null|RunEndEncoded|Struct_|Time|Timestamp|Union|Utf8|Utf8View) => Binary|Bool|Date|Decimal|Duration|FixedSizeBinary|FixedSizeList|FloatingPoint|Int|Interval|LargeBinary|LargeList|LargeUtf8|List|Map|Null|RunEndEncoded|Struct_|Time|Timestamp|Union|Utf8|Utf8View|null,
index: number
): Binary|Bool|Date|Decimal|Duration|FixedSizeBinary|FixedSizeList|FloatingPoint|Int|Interval|LargeBinary|LargeList|LargeUtf8|List|Map|Null|RunEndEncoded|Struct_|Time|Timestamp|Union|Utf8|null {
): Binary|Bool|Date|Decimal|Duration|FixedSizeBinary|FixedSizeList|FloatingPoint|Int|Interval|LargeBinary|LargeList|LargeUtf8|List|Map|Null|RunEndEncoded|Struct_|Time|Timestamp|Union|Utf8|Utf8View|null {
switch(Type[type]) {
case 'NONE': return null;
case 'Null': return accessor(index, new Null())! as Null;
Expand All @@ -116,6 +119,7 @@ export function unionListToType(
case 'LargeUtf8': return accessor(index, new LargeUtf8())! as LargeUtf8;
case 'LargeList': return accessor(index, new LargeList())! as LargeList;
case 'RunEndEncoded': return accessor(index, new RunEndEncoded())! as RunEndEncoded;
case 'Utf8View': return accessor(index, new Utf8View())! as Utf8View;
default: return null;
}
}
47 changes: 47 additions & 0 deletions src/fb/utf8-view.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// automatically generated by the FlatBuffers compiler, do not modify

/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */

import * as flatbuffers from 'flatbuffers';

/**
* Logically the same as Utf8, but the internal representation uses a view
* struct that contains the string length and either the string's entire data
* inline (for small strings) or an inlined prefix, an index of another buffer,
* and an offset pointing to a slice in that buffer (for non-small strings).
*
* Since it uses a variable number of data buffers, each Field with this type
* must have a corresponding entry in `variadicBufferCounts`.
*/
export class Utf8View {
bb: flatbuffers.ByteBuffer|null = null;
bb_pos = 0;
__init(i:number, bb:flatbuffers.ByteBuffer):Utf8View {
this.bb_pos = i;
this.bb = bb;
return this;
}

static getRootAsUtf8View(bb:flatbuffers.ByteBuffer, obj?:Utf8View):Utf8View {
return (obj || new Utf8View()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
}

static getSizePrefixedRootAsUtf8View(bb:flatbuffers.ByteBuffer, obj?:Utf8View):Utf8View {
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
return (obj || new Utf8View()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
}

static startUtf8View(builder:flatbuffers.Builder) {
builder.startObject(0);
}

static endUtf8View(builder:flatbuffers.Builder):flatbuffers.Offset {
const offset = builder.endObject();
return offset;
}

static createUtf8View(builder:flatbuffers.Builder):flatbuffers.Offset {
Utf8View.startUtf8View(builder);
return Utf8View.endUtf8View(builder);
}
}
4 changes: 4 additions & 0 deletions src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import type { FixedSizeListBuilder } from './builder/fixedsizelist.js';
import type { MapBuilder } from './builder/map.js';
import type { StructBuilder } from './builder/struct.js';
import type { UnionBuilder, SparseUnionBuilder, DenseUnionBuilder } from './builder/union.js';
import type { Utf8ViewBuilder } from "./builder/utf8view.js";

/** @ignore */ type FloatArray = Float32Array | Float64Array;
/** @ignore */ type IntArray = Int8Array | Int16Array | Int32Array;
Expand Down Expand Up @@ -209,6 +210,7 @@ export type TypeToDataType<T extends Type> = {
[Type.Float64]: type.Float64;
[Type.Float]: type.Float;
[Type.Utf8]: type.Utf8;
[Type.Utf8View]: type.Utf8View;
[Type.LargeUtf8]: type.LargeUtf8;
[Type.Binary]: type.Binary;
[Type.LargeBinary]: type.LargeBinary;
Expand Down Expand Up @@ -265,6 +267,7 @@ type TypeToBuilder<T extends Type = any, TNull = any> = {
[Type.Float64]: Float64Builder<TNull>;
[Type.Float]: FloatBuilder<any, TNull>;
[Type.Utf8]: Utf8Builder<TNull>;
[Type.Utf8View]: Utf8ViewBuilder<TNull>;
[Type.LargeUtf8]: LargeUtf8Builder<TNull>;
[Type.Binary]: BinaryBuilder<TNull>;
[Type.LargeBinary]: LargeBinaryBuilder<TNull>;
Expand Down Expand Up @@ -321,6 +324,7 @@ type DataTypeToBuilder<T extends DataType = any, TNull = any> = {
[Type.Float64]: T extends type.Float64 ? Float64Builder<TNull> : never;
[Type.Float]: T extends type.Float ? FloatBuilder<T, TNull> : never;
[Type.Utf8]: T extends type.Utf8 ? Utf8Builder<TNull> : never;
[Type.Utf8View]: T extends type.Utf8View ? Utf8ViewBuilder<TNull> : never;
[Type.LargeUtf8]: T extends type.LargeUtf8 ? LargeUtf8Builder<TNull> : never;
[Type.Binary]: T extends type.Binary ? BinaryBuilder<TNull> : never;
[Type.LargeBinary]: T extends type.LargeBinary ? LargeBinaryBuilder<TNull> : never;
Expand Down
3 changes: 2 additions & 1 deletion src/ipc/metadata/json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import { Schema, Field } from '../../schema.js';
import {
DataType, Dictionary, TimeBitWidth,
Utf8, LargeUtf8, Binary, LargeBinary, Decimal, FixedSizeBinary,
Utf8, Utf8View, LargeUtf8, Binary, LargeBinary, Decimal, FixedSizeBinary,
List, FixedSizeList, Map_, Struct, Union,
Bool, Null, Int, Float, Date_, Time, Interval, Timestamp, IntBitWidth, Int32, TKeys, Duration,
} from '../../type.js';
Expand Down Expand Up @@ -149,6 +149,7 @@ function typeFromJSON(f: any, children?: Field[]): DataType<any> {
case 'binary': return new Binary();
case 'largebinary': return new LargeBinary();
case 'utf8': return new Utf8();
case 'utf8view': return new Utf8View();
case 'largeutf8': return new LargeUtf8();
case 'bool': return new Bool();
case 'list': return new List((children || [])[0]);
Expand Down
3 changes: 2 additions & 1 deletion src/ipc/metadata/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ import {
DataType, Dictionary, TimeBitWidth,
Utf8, LargeUtf8, Binary, LargeBinary, Decimal, FixedSizeBinary,
List, FixedSizeList, Map_, Struct, Union,
Bool, Null, Int, Float, Date_, Time, Interval, Timestamp, IntBitWidth, Int32, TKeys, Duration,
Bool, Null, Int, Float, Date_, Time, Interval, Timestamp, IntBitWidth, Int32, TKeys, Duration, Utf8View,
} from '../../type.js';

/**
Expand Down Expand Up @@ -432,6 +432,7 @@ function decodeFieldType(f: _Field, children?: Field[]): DataType<any> {
case Type['Binary']: return new Binary();
case Type['LargeBinary']: return new LargeBinary();
case Type['Utf8']: return new Utf8();
case Type['Utf8View']: return new Utf8View();
case Type['LargeUtf8']: return new LargeUtf8();
case Type['Bool']: return new Bool();
case Type['List']: return new List((children || [])[0]);
Expand Down
Loading
Loading