Versions in this module Expand all Collapse all v0 v0.0.1 Mar 31, 2023 Changes in this version + const DateTransformVersion + const DefaultChunkSize + const DefaultTcpConnectionTimeout + const DeflateName + const EndRecord + const MetaChecksum + const MetaCount + const SnappyFramedName + const Version + var ArrowCrcErr = errors.New("crc value error when get a tunnel arrow stream") + var DeflateLevel = struct{ ... } + var InstanceSessionCfg = struct{ ... } + var SessionCfg = struct{ ... } + func Retry(f func() error) + func WrapByCompressor(rc io.ReadCloser, contentEncoding string) io.ReadCloser + type ArrowStreamReader struct + func NewArrowStreamReader(rc io.ReadCloser) *ArrowStreamReader + func (ar *ArrowStreamReader) Close() error + func (ar *ArrowStreamReader) Read(dst []byte) (int, error) + func (ar *ArrowStreamReader) ReadChunk() error + type ArrowStreamWriter struct + func NewArrowStreamWriter(w io.WriteCloser) *ArrowStreamWriter + func (aw *ArrowStreamWriter) Close() error + func (aw *ArrowStreamWriter) Write(data []byte) (int, error) + type Compressor interface + Name func() string + NewReader func(readCloser io.ReadCloser) io.ReadCloser + NewWriter func(writeCloser io.WriteCloser) io.WriteCloser + type Crc32CheckSum struct + func NewCrc32CheckSum() Crc32CheckSum + func (crc *Crc32CheckSum) Reset() + func (crc *Crc32CheckSum) Update(data interface{}) + func (crc *Crc32CheckSum) Value() uint32 + type Deflate struct + func (d Deflate) Name() string + func (d Deflate) NewReader(rc io.ReadCloser) io.ReadCloser + func (d Deflate) NewWriter(wc io.WriteCloser) io.WriteCloser + type DownLoadStatus int + const DownloadStatusClosed + const DownloadStatusExpired + const DownloadStatusInitiating + const DownloadStatusNormal + const DownloadStatusUnknown + func DownloadStatusFromStr(s string) DownLoadStatus + func (status DownLoadStatus) String() string + type DownloadSession struct + Async bool + Compressor Compressor + Id string + ProjectName string + RestClient restclient.RestClient + SchemaName string + ShardId int + TableName string + func AttachToExistedDownloadSession(sessionId, projectName, tableName string, restClient restclient.RestClient, ...) (*DownloadSession, error) + func CreateDownloadSession(projectName, tableName string, restClient restclient.RestClient, ...) (*DownloadSession, error) + func (ds *DownloadSession) ArrowSchema() *arrow.Schema + func (ds *DownloadSession) OpenRecordArrowReader(start, count int, columnNames []string) (*RecordArrowReader, error) + func (ds *DownloadSession) OpenRecordReader(start, count int, columnNames []string) (*RecordProtocReader, error) + func (ds *DownloadSession) PartitionKey() string + func (ds *DownloadSession) RecordCount() int + func (ds *DownloadSession) ResourceUrl() string + func (ds *DownloadSession) Schema() tableschema.TableSchema + func (ds *DownloadSession) SetPartitionKey(partitionKey string) + func (ds *DownloadSession) ShouldTransformDate() bool + func (ds *DownloadSession) Status() DownLoadStatus + type InstanceOption func(cfg *instanceSessionConfig) + type InstanceResultDownloadSession struct + Compressor Compressor + Id string + InstanceId string + IsLongPolling bool + LimitEnabled bool + ProjectName string + QueryId int + RestClient restclient.RestClient + TaskName string + func AttachToExistedIRDownloadSession(downloadId, projectName, instanceId string, restClient restclient.RestClient, ...) (*InstanceResultDownloadSession, error) + func CreateInstanceResultDownloadSession(projectName, instanceId string, restClient restclient.RestClient, ...) (*InstanceResultDownloadSession, error) + func (is *InstanceResultDownloadSession) OpenRecordReader(start, count, sizeLimit int, columnNames []string) (*RecordProtocReader, error) + func (is *InstanceResultDownloadSession) RecordCount() int + func (is *InstanceResultDownloadSession) ResourceUrl() string + func (is *InstanceResultDownloadSession) Schema() tableschema.TableSchema + func (is *InstanceResultDownloadSession) ShouldTransformDate() bool + func (is *InstanceResultDownloadSession) Status() DownLoadStatus + type Option func(cfg *sessionConfig) + type ProtocStreamReader struct + func NewProtocStreamReader(r io.Reader) *ProtocStreamReader + func (r *ProtocStreamReader) ReadBool() (bool, error) + func (r *ProtocStreamReader) ReadBytes() ([]byte, error) + func (r *ProtocStreamReader) ReadFixed32() (uint32, error) + func (r *ProtocStreamReader) ReadFixed64() (uint64, error) + func (r *ProtocStreamReader) ReadFloat32() (float32, error) + func (r *ProtocStreamReader) ReadFloat64() (float64, error) + func (r *ProtocStreamReader) ReadInt32() (int32, error) + func (r *ProtocStreamReader) ReadInt64() (int64, error) + func (r *ProtocStreamReader) ReadSFixed32() (int32, error) + func (r *ProtocStreamReader) ReadSFixed64() (int64, error) + func (r *ProtocStreamReader) ReadSInt32() (int32, error) + func (r *ProtocStreamReader) ReadSInt64() (int64, error) + func (r *ProtocStreamReader) ReadString() (string, error) + func (r *ProtocStreamReader) ReadTag() (protowire.Number, protowire.Type, error) + func (r *ProtocStreamReader) ReadUInt32() (uint32, error) + func (r *ProtocStreamReader) ReadUInt64() (uint64, error) + func (r *ProtocStreamReader) ReadVarint() (uint64, error) + type ProtocStreamWriter struct + func NewProtocStreamWriter(w io.Writer) *ProtocStreamWriter + func (r *ProtocStreamWriter) WriteBool(val bool) error + func (r *ProtocStreamWriter) WriteBytes(b []byte) error + func (r *ProtocStreamWriter) WriteFixed32(val uint32) error + func (r *ProtocStreamWriter) WriteFixed64(val uint64) error + func (r *ProtocStreamWriter) WriteFloat32(val float32) error + func (r *ProtocStreamWriter) WriteFloat64(val float64) error + func (r *ProtocStreamWriter) WriteInt32(val int32) error + func (r *ProtocStreamWriter) WriteInt64(val int64) error + func (r *ProtocStreamWriter) WriteSInt32(val int32) error + func (r *ProtocStreamWriter) WriteSInt64(val int64) error + func (r *ProtocStreamWriter) WriteTag(num protowire.Number, typ protowire.Type) error + func (r *ProtocStreamWriter) WriteUInt32(val uint32) error + func (r *ProtocStreamWriter) WriteUInt64(val uint64) error + func (r *ProtocStreamWriter) WriteVarint(v uint64) error + type RecordArrowReader struct + func (r *RecordArrowReader) Close() error + func (r *RecordArrowReader) HttpRes() *http.Response + func (r *RecordArrowReader) Iterator(f func(array.Record, error)) + func (r *RecordArrowReader) Read() (array.Record, error) + func (r *RecordArrowReader) RecordBatchReader() *ipc.RecordBatchReader + type RecordArrowWriter struct + func (writer *RecordArrowWriter) Close() error + func (writer *RecordArrowWriter) WriteArrowRecord(record array.Record) error + type RecordPackStreamWriter struct + func (rsw *RecordPackStreamWriter) Append(record data.Record) error + func (rsw *RecordPackStreamWriter) DataSize() int64 + func (rsw *RecordPackStreamWriter) Flush(timeout_ ...time.Duration) (string, error) + func (rsw *RecordPackStreamWriter) RecordCount() int64 + type RecordProtocReader struct + func (r *RecordProtocReader) Close() error + func (r *RecordProtocReader) HttpRes() *http.Response + func (r *RecordProtocReader) Iterator(f func(record data.Record, err error)) + func (r *RecordProtocReader) Read() (data.Record, error) + type RecordProtocWriter struct + func (r *RecordProtocWriter) Close() error + func (r *RecordProtocWriter) Write(record data.Record) error + type SnappyFramed int + func (s SnappyFramed) Name() string + func (s SnappyFramed) NewReader(rc io.ReadCloser) io.ReadCloser + func (s SnappyFramed) NewWriter(wc io.WriteCloser) io.WriteCloser + type StreamUploadSession struct + Columns []string + Compressor Compressor + CreatePartition bool + P2PMode bool + ProjectName string + RestClient restclient.RestClient + SchemaName string + SlotNum int + TableName string + func CreateStreamUploadSession(projectName, tableName string, restClient restclient.RestClient, ...) (*StreamUploadSession, error) + func (su *StreamUploadSession) OpenRecordPackWriter() *RecordPackStreamWriter + func (su *StreamUploadSession) ResourceUrl() string + func (su *StreamUploadSession) Schema() tableschema.TableSchema + type Tunnel struct + func NewTunnel(odpsIns *odps.Odps, endpoint string) Tunnel + func NewTunnelFromProject(project odps.Project) (Tunnel, error) + func (t *Tunnel) AttachToExistedDownloadSession(projectName, tableName, sessionId string, opts ...Option) (*DownloadSession, error) + func (t *Tunnel) AttachToExistedUploadSession(projectName, tableName, sessionId string, opts ...Option) (*UploadSession, error) + func (t *Tunnel) CreateDownloadSession(projectName, tableName string, opts ...Option) (*DownloadSession, error) + func (t *Tunnel) CreateInstanceResultDownloadSession(projectName, instanceId string, opts ...InstanceOption) (*InstanceResultDownloadSession, error) + func (t *Tunnel) CreateStreamUploadSession(projectName, tableName string, opts ...Option) (*StreamUploadSession, error) + func (t *Tunnel) CreateUploadSession(projectName, tableName string, opts ...Option) (*UploadSession, error) + func (t *Tunnel) HttpTimeout() time.Duration + func (t *Tunnel) SetHttpTimeout(httpTimeout time.Duration) + func (t *Tunnel) SetTcpConnectionTimeout(tcpConnectionTimeout time.Duration) + func (t *Tunnel) TcpConnectionTimeout() time.Duration + type UploadSession struct + Compressor Compressor + Id string + Overwrite bool + ProjectName string + RestClient restclient.RestClient + SchemaName string + TableName string + func AttachToExistedUploadSession(sessionId, projectName, tableName string, restClient restclient.RestClient, ...) (*UploadSession, error) + func CreateUploadSession(projectName, tableName string, restClient restclient.RestClient, ...) (*UploadSession, error) + func (u *UploadSession) ArrowSchema() *arrow.Schema + func (u *UploadSession) BlockIds() []int + func (u *UploadSession) Commit(blockIds []int) error + func (u *UploadSession) Load() error + func (u *UploadSession) OpenRecordArrowWriter(blockId int) (*RecordArrowWriter, error) + func (u *UploadSession) OpenRecordWriter(blockId int) (*RecordProtocWriter, error) + func (u *UploadSession) PartitionKey() string + func (u *UploadSession) ResourceUrl() string + func (u *UploadSession) Schema() tableschema.TableSchema + func (u *UploadSession) SetPartitionKey(partitionKey string) + func (u *UploadSession) ShouldTransform() bool + func (u *UploadSession) Status() UploadStatus + type UploadStatus int + const UploadStatusCanceled + const UploadStatusClosed + const UploadStatusClosing + const UploadStatusCommitting + const UploadStatusCritical + const UploadStatusExpired + const UploadStatusNormal + const UploadStatusUnknown + func UploadStatusFromStr(s string) UploadStatus + func (status UploadStatus) String() string