]>
Commit | Line | Data |
---|---|---|
1d09f67e TL |
1 | // Licensed to the Apache Software Foundation (ASF) under one |
2 | // or more contributor license agreements. See the NOTICE file | |
3 | // distributed with this work for additional information | |
4 | // regarding copyright ownership. The ASF licenses this file | |
5 | // to you under the Apache License, Version 2.0 (the | |
6 | // "License"); you may not use this file except in compliance | |
7 | // with the License. You may obtain a copy of the License at | |
8 | // | |
9 | // http://www.apache.org/licenses/LICENSE-2.0 | |
10 | // | |
11 | // Unless required by applicable law or agreed to in writing, | |
12 | // software distributed under the License is distributed on an | |
13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | |
14 | // KIND, either express or implied. See the License for the | |
15 | // specific language governing permissions and limitations | |
16 | // under the License. | |
17 | ||
18 | import { Vector } from '../vector'; | |
19 | import { Chunked } from './chunked'; | |
20 | import { BaseVector } from './base'; | |
21 | import { Binary, Utf8 } from '../type'; | |
22 | import { VectorBuilderOptions } from './index'; | |
23 | import { vectorFromValuesWithType } from './index'; | |
24 | import { VectorBuilderOptionsAsync } from './index'; | |
25 | ||
26 | /** @ignore */ | |
27 | export class Utf8Vector extends BaseVector<Utf8> { | |
28 | public static from<TNull = any>(input: Iterable<string | TNull>): Utf8Vector; | |
29 | public static from<TNull = any>(input: AsyncIterable<string | TNull>): Promise<Utf8Vector>; | |
30 | public static from<TNull = any>(input: VectorBuilderOptions<Utf8, string | TNull>): Chunked<Utf8>; | |
31 | public static from<TNull = any>(input: VectorBuilderOptionsAsync<Utf8, string | TNull>): Promise<Chunked<Utf8>>; | |
32 | /** @nocollapse */ | |
33 | public static from<TNull = any>(input: Iterable<string | TNull> | AsyncIterable<string | TNull> | VectorBuilderOptions<Utf8, string | TNull> | VectorBuilderOptionsAsync<Utf8, string | TNull>) { | |
34 | return vectorFromValuesWithType(() => new Utf8(), input); | |
35 | } | |
36 | public asBinary() { | |
37 | return Vector.new(this.data.clone(new Binary())); | |
38 | } | |
39 | } |