client

package
v2.0.3-1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 20, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BYTE_ARRAY_COLUMN_ENCODING = ColumnEncoding(iota)
	INT32_ARRAY_COLUMN_ENCODING
	INT64_ARRAY_COLUMN_ENCODING
	BINARY_ARRAY_COLUMN_ENCODING
	RLE_COLUMN_ENCODING
)
View Source
const (
	SuccessStatus       int32 = 200
	IncompatibleVersion int32 = 201
	ConfigurationError  int32 = 202
	StartUpError        int32 = 203
	ShutDownError       int32 = 204

	UnsupportedOperation    int32 = 300
	ExecuteStatementError   int32 = 301
	MultipleError           int32 = 302
	IllegalParameter        int32 = 303
	OverlapWithExistingTask int32 = 304
	InternalServerError     int32 = 305

	RedirectionRecommend int32 = 400

	DatabaseNotExist        int32 = 500
	DatabaseAlreadyExists   int32 = 501
	SeriesOverflow          int32 = 502
	TimeseriesAlreadyExist  int32 = 503
	TimeseriesInBlackList   int32 = 504
	AliasAlreadyExist       int32 = 505
	PathAlreadyExist        int32 = 506
	MetadataError           int32 = 507
	PathNotExist            int32 = 508
	IllegalPath             int32 = 509
	CreateTemplateError     int32 = 510
	DuplicatedTemplate      int32 = 511
	UndefinedTemplate       int32 = 512
	TemplateNotSet          int32 = 513
	DifferentTemplate       int32 = 514
	TemplateIsInUse         int32 = 515
	TemplateIncompatible    int32 = 516
	SegmentNotFound         int32 = 517
	PageOutOfSpace          int32 = 518
	RecordDuplicated        int32 = 519
	SegmentOutOfSpace       int32 = 520
	SchemaFileNotExists     int32 = 521
	OversizeRecord          int32 = 522
	SchemaFileRedoLogBroken int32 = 523
	TemplateNotActivated    int32 = 524

	SystemReadOnly         int32 = 600
	StorageEngineError     int32 = 601
	StorageEngineNotReady  int32 = 602
	DataregionProcessError int32 = 603
	TsfileProcessorError   int32 = 604
	WriteProcessError      int32 = 605
	WriteProcessReject     int32 = 606
	OutOfTtl               int32 = 607
	CompactionError        int32 = 608
	AlignedTimeseriesError int32 = 609
	WalError               int32 = 610
	DiskSpaceInsufficient  int32 = 611

	SqlParseError             int32 = 700
	SemanticError             int32 = 701
	GenerateTimeZoneError     int32 = 702
	SetTimeZoneError          int32 = 703
	QueryNotAllowed           int32 = 704
	LogicalOperatorError      int32 = 705
	LogicalOptimizeError      int32 = 706
	UnsupportedFillType       int32 = 707
	QueryProcessError         int32 = 708
	MppMemoryNotEnough        int32 = 709
	CloseOperationError       int32 = 710
	TsblockSerializeError     int32 = 711
	InternalRequestTimeOut    int32 = 712
	InternalRequestRetryError int32 = 713

	InitAuthError             int32 = 800
	WrongLoginPassword        int32 = 801
	NotLogin                  int32 = 802
	NoPermission              int32 = 803
	UserNotExist              int32 = 804
	UserAlreadyExist          int32 = 805
	UserAlreadyHasRole        int32 = 806
	UserNotHasRole            int32 = 807
	RoleNotExist              int32 = 808
	RoleAlreadyExist          int32 = 809
	AlreadyHasPrivilege       int32 = 810
	NotHasPrivilege           int32 = 811
	ClearPermissionCacheError int32 = 812
	UnknownAuthPrivilege      int32 = 813
	UnsupportedAuthOperation  int32 = 814
	AuthIoException           int32 = 815

	MigrateRegionError        int32 = 900
	CreateRegionError         int32 = 901
	DeleteRegionError         int32 = 902
	PartitionCacheUpdateError int32 = 903
	ConsensusNotInitialized   int32 = 904
	RegionLeaderChangeError   int32 = 905
	NoAvailableRegionGroup    int32 = 906

	DatanodeAlreadyRegistered int32 = 1000
	NoEnoughDatanode          int32 = 1001
	AddConfignodeError        int32 = 1002
	RemoveConfignodeError     int32 = 1003
	DatanodeNotExist          int32 = 1004
	DatanodeStopError         int32 = 1005
	RemoveDatanodeError       int32 = 1006
	RegisterRemovedDatanode   int32 = 1007
	CanNotConnectDatanode     int32 = 1008

	LoadFileError                 int32 = 1100
	LoadPieceOfTsfileError        int32 = 1101
	DeserializePieceOfTsfileError int32 = 1102
	SyncConnectionError           int32 = 1103
	SyncFileRedirectionError      int32 = 1104
	SyncFileError                 int32 = 1105
	CreatePipeSinkError           int32 = 1106
	PipeError                     int32 = 1107
	PipeserverError               int32 = 1108
	VerifyMetadataError           int32 = 1109

	UdfLoadClassError        int32 = 1200
	UdfDownloadError         int32 = 1201
	CreateUdfOnDatanodeError int32 = 1202
	DropUdfOnDatanodeError   int32 = 1203

	CreateTriggerError         int32 = 1300
	DropTriggerError           int32 = 1301
	TriggerFireError           int32 = 1302
	TriggerLoadClassError      int32 = 1303
	TriggerDownloadError       int32 = 1304
	CreateTriggerInstanceError int32 = 1305
	ActiveTriggerInstanceError int32 = 1306
	DropTriggerInstanceError   int32 = 1307
	UpdateTriggerLocationError int32 = 1308

	NoSuchCq                  int32 = 1400
	CqAlreadyActive           int32 = 1401
	CqAlreadyExist            int32 = 1402
	CqUpdateLastExecTimeError int32 = 1403
)

TSStatusCode

View Source
const (
	DefaultTimeZone        = "Asia/Shanghai"
	DefaultFetchSize       = 1024
	DefaultConnectRetryMax = 3
	TreeSqlDialect         = "tree"
	TableSqlDialect        = "table"
)
View Source
const (
	V_0_12          = Version("V_0_12")
	V_0_13          = Version("V_0_13")
	V_1_0           = Version("V_1_0")
	DEFAULT_VERSION = V_1_0
)
View Source
const (
	TAG = iota
	FIELD
	ATTRIBUTE
)
View Source
const (
	DEFAULT_TIME_FORMAT = "default"
	TIME_PRECISION      = "timestamp_precision"
	MILLISECOND         = "ms"
	MICROSECOND         = "us"
	NANOSECOND          = "ns"
)
View Source
const (
	TimestampColumnName = "Time"
)

Variables

View Source
var BitUtil = []byte{1, 2, 4, 8, 16, 32, 64, 128}
View Source
var UnmarkBitUtil = []byte{
	0xFE,
	0xFD,
	0xFB,
	0xF7,
	0xEF,
	0xDF,
	0xBF,
	0x7F,
}

Functions

func DateToInt32

func DateToInt32(localDate time.Time) (int32, error)

func Int32ToDate

func Int32ToDate(val int32) (time.Time, error)

func VerifySuccess

func VerifySuccess(status *common.TSStatus) error

Types

type BatchError

type BatchError struct {
	// contains filtered or unexported fields
}

func NewBatchError

func NewBatchError(statuses []*common.TSStatus) *BatchError

func (*BatchError) Error

func (e *BatchError) Error() string

func (*BatchError) GetStatuses

func (e *BatchError) GetStatuses() []*common.TSStatus

type Binary

type Binary struct {
	// contains filtered or unexported fields
}

func NewBinary

func NewBinary(v []byte) *Binary

func (*Binary) GetStringValue

func (b *Binary) GetStringValue() string

func (*Binary) GetValues

func (b *Binary) GetValues() []byte

type BinaryArrayColumnDecoder

type BinaryArrayColumnDecoder struct {
	// contains filtered or unexported fields
}

func (*BinaryArrayColumnDecoder) ReadColumn

func (decoder *BinaryArrayColumnDecoder) ReadColumn(reader *bytes.Reader, dataType TSDataType, positionCount int32) (Column, error)

type BinaryColumn

type BinaryColumn struct {
	// contains filtered or unexported fields
}

func NewBinaryColumn

func NewBinaryColumn(arrayOffset int32, positionCount int32, valueIsNull []bool, values []*Binary) (*BinaryColumn, error)

func (*BinaryColumn) GetBinaries

func (c *BinaryColumn) GetBinaries() ([]*Binary, error)

func (*BinaryColumn) GetBinary

func (c *BinaryColumn) GetBinary(position int32) (*Binary, error)

func (*BinaryColumn) GetBoolean

func (c *BinaryColumn) GetBoolean(_ int32) (bool, error)

func (*BinaryColumn) GetBooleans

func (c *BinaryColumn) GetBooleans() ([]bool, error)

func (*BinaryColumn) GetDataType

func (c *BinaryColumn) GetDataType() TSDataType

func (*BinaryColumn) GetDouble

func (c *BinaryColumn) GetDouble(_ int32) (float64, error)

func (*BinaryColumn) GetDoubles

func (c *BinaryColumn) GetDoubles() ([]float64, error)

func (*BinaryColumn) GetEncoding

func (c *BinaryColumn) GetEncoding() ColumnEncoding

func (*BinaryColumn) GetFloat

func (c *BinaryColumn) GetFloat(_ int32) (float32, error)

func (*BinaryColumn) GetFloats

func (c *BinaryColumn) GetFloats() ([]float32, error)

func (*BinaryColumn) GetInt

func (c *BinaryColumn) GetInt(_ int32) (int32, error)

func (*BinaryColumn) GetInts

func (c *BinaryColumn) GetInts() ([]int32, error)

func (*BinaryColumn) GetLong

func (c *BinaryColumn) GetLong(_ int32) (int64, error)

func (*BinaryColumn) GetLongs

func (c *BinaryColumn) GetLongs() ([]int64, error)

func (*BinaryColumn) GetObject

func (c *BinaryColumn) GetObject(position int32) (interface{}, error)

func (*BinaryColumn) GetObjects

func (c *BinaryColumn) GetObjects() ([]interface{}, error)

func (*BinaryColumn) GetPositionCount

func (c *BinaryColumn) GetPositionCount() int32

func (*BinaryColumn) IsNull

func (c *BinaryColumn) IsNull(position int32) bool

func (*BinaryColumn) IsNulls

func (c *BinaryColumn) IsNulls() []bool

func (*BinaryColumn) MayHaveNull

func (c *BinaryColumn) MayHaveNull() bool

type BitMap

type BitMap struct {
	// contains filtered or unexported fields
}

func NewBitMap

func NewBitMap(size int) *BitMap

func (*BitMap) GetBits

func (b *BitMap) GetBits() []byte

func (*BitMap) IsAllUnmarked

func (b *BitMap) IsAllUnmarked() bool

func (*BitMap) IsMarked

func (b *BitMap) IsMarked(position int) bool

func (*BitMap) Mark

func (b *BitMap) Mark(position int)

func (*BitMap) UnMark

func (b *BitMap) UnMark(position int)

type BooleanColumn

type BooleanColumn struct {
	// contains filtered or unexported fields
}

func NewBooleanColumn

func NewBooleanColumn(arrayOffset int32, positionCount int32, valueIsNull []bool, values []bool) (*BooleanColumn, error)

func (*BooleanColumn) GetBinaries

func (c *BooleanColumn) GetBinaries() ([]*Binary, error)

func (*BooleanColumn) GetBinary

func (c *BooleanColumn) GetBinary(_ int32) (*Binary, error)

func (*BooleanColumn) GetBoolean

func (c *BooleanColumn) GetBoolean(position int32) (bool, error)

func (*BooleanColumn) GetBooleans

func (c *BooleanColumn) GetBooleans() ([]bool, error)

func (*BooleanColumn) GetDataType

func (c *BooleanColumn) GetDataType() TSDataType

func (*BooleanColumn) GetDouble

func (c *BooleanColumn) GetDouble(_ int32) (float64, error)

func (*BooleanColumn) GetDoubles

func (c *BooleanColumn) GetDoubles() ([]float64, error)

func (*BooleanColumn) GetEncoding

func (c *BooleanColumn) GetEncoding() ColumnEncoding

func (*BooleanColumn) GetFloat

func (c *BooleanColumn) GetFloat(_ int32) (float32, error)

func (*BooleanColumn) GetFloats

func (c *BooleanColumn) GetFloats() ([]float32, error)

func (*BooleanColumn) GetInt

func (c *BooleanColumn) GetInt(_ int32) (int32, error)

func (*BooleanColumn) GetInts

func (c *BooleanColumn) GetInts() ([]int32, error)

func (*BooleanColumn) GetLong

func (c *BooleanColumn) GetLong(_ int32) (int64, error)

func (*BooleanColumn) GetLongs

func (c *BooleanColumn) GetLongs() ([]int64, error)

func (*BooleanColumn) GetObject

func (c *BooleanColumn) GetObject(position int32) (interface{}, error)

func (*BooleanColumn) GetObjects

func (c *BooleanColumn) GetObjects() ([]interface{}, error)

func (*BooleanColumn) GetPositionCount

func (c *BooleanColumn) GetPositionCount() int32

func (*BooleanColumn) IsNull

func (c *BooleanColumn) IsNull(position int32) bool

func (*BooleanColumn) IsNulls

func (c *BooleanColumn) IsNulls() []bool

func (*BooleanColumn) MayHaveNull

func (c *BooleanColumn) MayHaveNull() bool

type ByteArrayColumnDecoder

type ByteArrayColumnDecoder struct {
	// contains filtered or unexported fields
}

func (*ByteArrayColumnDecoder) ReadColumn

func (decoder *ByteArrayColumnDecoder) ReadColumn(reader *bytes.Reader, dataType TSDataType, positionCount int32) (Column, error)

type ClusterConfig

type ClusterConfig struct {
	NodeUrls        []string //ip:port
	UserName        string
	Password        string
	FetchSize       int32
	TimeZone        string
	ConnectRetryMax int

	Database string
	// contains filtered or unexported fields
}

type Column

type Column interface {
	GetDataType() TSDataType
	GetEncoding() ColumnEncoding
	GetBoolean(position int32) (bool, error)
	GetInt(position int32) (int32, error)
	GetLong(position int32) (int64, error)
	GetFloat(position int32) (float32, error)
	GetDouble(position int32) (float64, error)
	GetBinary(position int32) (*Binary, error)
	GetObject(position int32) (interface{}, error)

	GetBooleans() ([]bool, error)
	GetInts() ([]int32, error)
	GetLongs() ([]int64, error)
	GetFloats() ([]float32, error)
	GetDoubles() ([]float64, error)
	GetBinaries() ([]*Binary, error)
	GetObjects() ([]interface{}, error)

	MayHaveNull() bool
	IsNull(position int32) bool
	IsNulls() []bool

	GetPositionCount() int32
}

type ColumnCategory

type ColumnCategory int8

type ColumnDecoder

type ColumnDecoder interface {
	ReadColumn(reader *bytes.Reader, dataType TSDataType, positionCount int32) (Column, error)
}

type ColumnEncoding

type ColumnEncoding uint8

type Config

type Config struct {
	Host            string
	Port            string
	UserName        string
	Password        string
	FetchSize       int32
	TimeZone        string
	ConnectRetryMax int

	Version  Version
	Database string
	// contains filtered or unexported fields
}

type DoubleColumn

type DoubleColumn struct {
	// contains filtered or unexported fields
}

func NewDoubleColumn

func NewDoubleColumn(arrayOffset int32, positionCount int32, valueIsNull []bool, values []float64) (*DoubleColumn, error)

func (*DoubleColumn) GetBinaries

func (c *DoubleColumn) GetBinaries() ([]*Binary, error)

func (*DoubleColumn) GetBinary

func (c *DoubleColumn) GetBinary(_ int32) (*Binary, error)

func (*DoubleColumn) GetBoolean

func (c *DoubleColumn) GetBoolean(_ int32) (bool, error)

func (*DoubleColumn) GetBooleans

func (c *DoubleColumn) GetBooleans() ([]bool, error)

func (*DoubleColumn) GetDataType

func (c *DoubleColumn) GetDataType() TSDataType

func (*DoubleColumn) GetDouble

func (c *DoubleColumn) GetDouble(position int32) (float64, error)

func (*DoubleColumn) GetDoubles

func (c *DoubleColumn) GetDoubles() ([]float64, error)

func (*DoubleColumn) GetEncoding

func (c *DoubleColumn) GetEncoding() ColumnEncoding

func (*DoubleColumn) GetFloat

func (c *DoubleColumn) GetFloat(_ int32) (float32, error)

func (*DoubleColumn) GetFloats

func (c *DoubleColumn) GetFloats() ([]float32, error)

func (*DoubleColumn) GetInt

func (c *DoubleColumn) GetInt(_ int32) (int32, error)

func (*DoubleColumn) GetInts

func (c *DoubleColumn) GetInts() ([]int32, error)

func (*DoubleColumn) GetLong

func (c *DoubleColumn) GetLong(_ int32) (int64, error)

func (*DoubleColumn) GetLongs

func (c *DoubleColumn) GetLongs() ([]int64, error)

func (*DoubleColumn) GetObject

func (c *DoubleColumn) GetObject(position int32) (interface{}, error)

func (*DoubleColumn) GetObjects

func (c *DoubleColumn) GetObjects() ([]interface{}, error)

func (*DoubleColumn) GetPositionCount

func (c *DoubleColumn) GetPositionCount() int32

func (*DoubleColumn) IsNull

func (c *DoubleColumn) IsNull(position int32) bool

func (*DoubleColumn) IsNulls

func (c *DoubleColumn) IsNulls() []bool

func (*DoubleColumn) MayHaveNull

func (c *DoubleColumn) MayHaveNull() bool

type Field

type Field struct {
	// contains filtered or unexported fields
}

func (*Field) GetDataType

func (f *Field) GetDataType() TSDataType

func (*Field) GetFloat32

func (f *Field) GetFloat32() float32

func (*Field) GetFloat64

func (f *Field) GetFloat64() float64

func (*Field) GetInt32

func (f *Field) GetInt32() int32

func (*Field) GetInt64

func (f *Field) GetInt64() int64

func (*Field) GetName

func (f *Field) GetName() string

func (*Field) GetText

func (f *Field) GetText() string

func (*Field) GetValue

func (f *Field) GetValue() interface{}

func (*Field) IsNull

func (f *Field) IsNull() bool

type FloatColumn

type FloatColumn struct {
	// contains filtered or unexported fields
}

func NewFloatColumn

func NewFloatColumn(arrayOffset int32, positionCount int32, valueIsNull []bool, values []float32) (*FloatColumn, error)

func (*FloatColumn) GetBinaries

func (c *FloatColumn) GetBinaries() ([]*Binary, error)

func (*FloatColumn) GetBinary

func (c *FloatColumn) GetBinary(_ int32) (*Binary, error)

func (*FloatColumn) GetBoolean

func (c *FloatColumn) GetBoolean(_ int32) (bool, error)

func (*FloatColumn) GetBooleans

func (c *FloatColumn) GetBooleans() ([]bool, error)

func (*FloatColumn) GetDataType

func (c *FloatColumn) GetDataType() TSDataType

func (*FloatColumn) GetDouble

func (c *FloatColumn) GetDouble(_ int32) (float64, error)

func (*FloatColumn) GetDoubles

func (c *FloatColumn) GetDoubles() ([]float64, error)

func (*FloatColumn) GetEncoding

func (c *FloatColumn) GetEncoding() ColumnEncoding

func (*FloatColumn) GetFloat

func (c *FloatColumn) GetFloat(position int32) (float32, error)

func (*FloatColumn) GetFloats

func (c *FloatColumn) GetFloats() ([]float32, error)

func (*FloatColumn) GetInt

func (c *FloatColumn) GetInt(_ int32) (int32, error)

func (*FloatColumn) GetInts

func (c *FloatColumn) GetInts() ([]int32, error)

func (*FloatColumn) GetLong

func (c *FloatColumn) GetLong(_ int32) (int64, error)

func (*FloatColumn) GetLongs

func (c *FloatColumn) GetLongs() ([]int64, error)

func (*FloatColumn) GetObject

func (c *FloatColumn) GetObject(position int32) (interface{}, error)

func (*FloatColumn) GetObjects

func (c *FloatColumn) GetObjects() ([]interface{}, error)

func (*FloatColumn) GetPositionCount

func (c *FloatColumn) GetPositionCount() int32

func (*FloatColumn) IsNull

func (c *FloatColumn) IsNull(position int32) bool

func (*FloatColumn) IsNulls

func (c *FloatColumn) IsNulls() []bool

func (*FloatColumn) MayHaveNull

func (c *FloatColumn) MayHaveNull() bool

type ITableSession

type ITableSession interface {

	// Insert inserts a Tablet into the database.
	//
	// Parameters:
	//   - tablet: A pointer to a Tablet containing time-series data to be inserted.
	//
	// Returns:
	//   - r: A pointer to TSStatus indicating the execution result.
	//   - err: An error if an issue occurs during the operation, such as a connection error or execution failure.
	Insert(tablet *Tablet) (r *common.TSStatus, err error)

	// ExecuteNonQueryStatement executes a non-query SQL statement, such as a DDL or DML command.
	//
	// Parameters:
	//   - sql: The SQL statement to execute.
	//
	// Returns:
	//   - r: A pointer to TSStatus indicating the execution result.
	//   - err: An error if an issue occurs during the operation, such as a connection error or execution failure.
	ExecuteNonQueryStatement(sql string) (r *common.TSStatus, err error)

	// ExecuteQueryStatement executes a query SQL statement and returns the result set.
	//
	// Parameters:
	//   - sql: The SQL query statement to execute.
	//   - timeoutInMs: A pointer to the timeout duration in milliseconds for the query execution.
	//
	// Returns:
	//   - result: A pointer to SessionDataSet containing the query results.
	//   - err: An error if an issue occurs during the operation, such as a connection error or execution failure.
	ExecuteQueryStatement(sql string, timeoutInMs *int64) (*SessionDataSet, error)

	// Close closes the session, releasing any held resources.
	//
	// Returns:
	//   - err: An error if there is an issue with closing the IoTDB connection.
	Close() (err error)
}

ITableSession defines an interface for interacting with IoTDB tables. It supports operations such as data insertion, executing queries, and closing the session. Implementations of this interface are expected to manage connections and ensure proper resource cleanup.

Each method may return an error to indicate issues such as connection errors or execution failures.

Since this interface includes a Close method, it is recommended to use defer to ensure the session is properly closed.

func NewClusterTableSession

func NewClusterTableSession(clusterConfig *ClusterConfig, enableRPCCompression bool) (ITableSession, error)

NewClusterTableSession creates a new TableSession instance for a cluster setup.

Parameters:

  • clusterConfig: The configuration for the cluster session.
  • enableRPCCompression: A boolean indicating whether RPC compression is enabled.

Returns:

  • An ITableSession instance if the session is successfully created.
  • An error if there is an issue during session initialization.

func NewTableSession

func NewTableSession(config *Config, enableRPCCompression bool, connectionTimeoutInMs int) (ITableSession, error)

NewTableSession creates a new TableSession instance using the provided configuration.

Parameters:

  • config: The configuration for the session.
  • enableRPCCompression: A boolean indicating whether RPC compression is enabled.
  • connectionTimeoutInMs: The timeout in milliseconds for establishing a connection.

Returns:

  • An ITableSession instance if the session is successfully created.
  • An error if there is an issue during session initialization.

type Int32ArrayColumnDecoder

type Int32ArrayColumnDecoder struct {
	// contains filtered or unexported fields
}

func (*Int32ArrayColumnDecoder) ReadColumn

func (decoder *Int32ArrayColumnDecoder) ReadColumn(reader *bytes.Reader, dataType TSDataType, positionCount int32) (Column, error)

type Int64ArrayColumnDecoder

type Int64ArrayColumnDecoder struct {
	// contains filtered or unexported fields
}

func (*Int64ArrayColumnDecoder) ReadColumn

func (decoder *Int64ArrayColumnDecoder) ReadColumn(reader *bytes.Reader, dataType TSDataType, positionCount int32) (Column, error)

type IntColumn

type IntColumn struct {
	// contains filtered or unexported fields
}

func NewIntColumn

func NewIntColumn(arrayOffset int32, positionCount int32, valueIsNull []bool, values []int32) (*IntColumn, error)

func (*IntColumn) GetBinaries

func (c *IntColumn) GetBinaries() ([]*Binary, error)

func (*IntColumn) GetBinary

func (c *IntColumn) GetBinary(_ int32) (*Binary, error)

func (*IntColumn) GetBoolean

func (c *IntColumn) GetBoolean(_ int32) (bool, error)

func (*IntColumn) GetBooleans

func (c *IntColumn) GetBooleans() ([]bool, error)

func (*IntColumn) GetDataType

func (c *IntColumn) GetDataType() TSDataType

func (*IntColumn) GetDouble

func (c *IntColumn) GetDouble(_ int32) (float64, error)

func (*IntColumn) GetDoubles

func (c *IntColumn) GetDoubles() ([]float64, error)

func (*IntColumn) GetEncoding

func (c *IntColumn) GetEncoding() ColumnEncoding

func (*IntColumn) GetFloat

func (c *IntColumn) GetFloat(_ int32) (float32, error)

func (*IntColumn) GetFloats

func (c *IntColumn) GetFloats() ([]float32, error)

func (*IntColumn) GetInt

func (c *IntColumn) GetInt(position int32) (int32, error)

func (*IntColumn) GetInts

func (c *IntColumn) GetInts() ([]int32, error)

func (*IntColumn) GetLong

func (c *IntColumn) GetLong(_ int32) (int64, error)

func (*IntColumn) GetLongs

func (c *IntColumn) GetLongs() ([]int64, error)

func (*IntColumn) GetObject

func (c *IntColumn) GetObject(position int32) (interface{}, error)

func (*IntColumn) GetObjects

func (c *IntColumn) GetObjects() ([]interface{}, error)

func (*IntColumn) GetPositionCount

func (c *IntColumn) GetPositionCount() int32

func (*IntColumn) IsNull

func (c *IntColumn) IsNull(position int32) bool

func (*IntColumn) IsNulls

func (c *IntColumn) IsNulls() []bool

func (*IntColumn) MayHaveNull

func (c *IntColumn) MayHaveNull() bool

type IoTDBRpcDataSet

type IoTDBRpcDataSet struct {
	// contains filtered or unexported fields
}

func NewIoTDBRpcDataSet

func NewIoTDBRpcDataSet(sql string, columnNameList []string, columnTypeList []string, columnNameIndex map[string]int32, ignoreTimestamp bool, moreData bool, queryId int64, statementId int64, client *rpc.IClientRPCServiceClient, sessionId int64, queryResult [][]byte, fetchSize int32, timeout *int64, zoneId string, timeFormat string, timeFactor int32, columnIndex2TsBlockColumnIndexList []int32) (rpcDataSet *IoTDBRpcDataSet, err error)

func (*IoTDBRpcDataSet) Close

func (s *IoTDBRpcDataSet) Close() (err error)

func (*IoTDBRpcDataSet) GetColumnNameTypeList

func (s *IoTDBRpcDataSet) GetColumnNameTypeList() []string

func (*IoTDBRpcDataSet) GetColumnSize

func (s *IoTDBRpcDataSet) GetColumnSize() int32

func (*IoTDBRpcDataSet) GetColumnTypeList

func (s *IoTDBRpcDataSet) GetColumnTypeList() []string

func (*IoTDBRpcDataSet) GetCurrentRowTime

func (s *IoTDBRpcDataSet) GetCurrentRowTime() int64

func (*IoTDBRpcDataSet) GetDate

func (s *IoTDBRpcDataSet) GetDate(columnName string) (time.Time, error)

func (*IoTDBRpcDataSet) GetDateByIndex

func (s *IoTDBRpcDataSet) GetDateByIndex(columnIndex int32) (time.Time, error)

func (*IoTDBRpcDataSet) GetDateByTsBlockColumnIndex

func (s *IoTDBRpcDataSet) GetDateByTsBlockColumnIndex(tsBlockColumnIndex int32) (time.Time, error)

func (*IoTDBRpcDataSet) GetFetchSize

func (s *IoTDBRpcDataSet) GetFetchSize() int32

func (*IoTDBRpcDataSet) GetValueColumnStartIndex

func (s *IoTDBRpcDataSet) GetValueColumnStartIndex() int32

func (*IoTDBRpcDataSet) HasCachedRecord

func (s *IoTDBRpcDataSet) HasCachedRecord() bool

func (*IoTDBRpcDataSet) IsClosed

func (s *IoTDBRpcDataSet) IsClosed() bool

func (*IoTDBRpcDataSet) IsIgnoreTimestamp

func (s *IoTDBRpcDataSet) IsIgnoreTimestamp() bool

func (*IoTDBRpcDataSet) IsLastReadWasNull

func (s *IoTDBRpcDataSet) IsLastReadWasNull() bool

func (*IoTDBRpcDataSet) Next

func (s *IoTDBRpcDataSet) Next() (result bool, err error)

func (*IoTDBRpcDataSet) SetFetchSize

func (s *IoTDBRpcDataSet) SetFetchSize(fetchSize int32)

func (*IoTDBRpcDataSet) SetHasCachedRecord

func (s *IoTDBRpcDataSet) SetHasCachedRecord(hasCachedRecord bool)

type LongColumn

type LongColumn struct {
	// contains filtered or unexported fields
}

func NewLongColumn

func NewLongColumn(arrayOffset int32, positionCount int32, valueIsNull []bool, values []int64) (*LongColumn, error)

func (*LongColumn) GetBinaries

func (c *LongColumn) GetBinaries() ([]*Binary, error)

func (*LongColumn) GetBinary

func (c *LongColumn) GetBinary(_ int32) (*Binary, error)

func (*LongColumn) GetBoolean

func (c *LongColumn) GetBoolean(_ int32) (bool, error)

func (*LongColumn) GetBooleans

func (c *LongColumn) GetBooleans() ([]bool, error)

func (*LongColumn) GetDataType

func (c *LongColumn) GetDataType() TSDataType

func (*LongColumn) GetDouble

func (c *LongColumn) GetDouble(_ int32) (float64, error)

func (*LongColumn) GetDoubles

func (c *LongColumn) GetDoubles() ([]float64, error)

func (*LongColumn) GetEncoding

func (c *LongColumn) GetEncoding() ColumnEncoding

func (*LongColumn) GetFloat

func (c *LongColumn) GetFloat(_ int32) (float32, error)

func (*LongColumn) GetFloats

func (c *LongColumn) GetFloats() ([]float32, error)

func (*LongColumn) GetInt

func (c *LongColumn) GetInt(_ int32) (int32, error)

func (*LongColumn) GetInts

func (c *LongColumn) GetInts() ([]int32, error)

func (*LongColumn) GetLong

func (c *LongColumn) GetLong(position int32) (int64, error)

func (*LongColumn) GetLongs

func (c *LongColumn) GetLongs() ([]int64, error)

func (*LongColumn) GetObject

func (c *LongColumn) GetObject(position int32) (interface{}, error)

func (*LongColumn) GetObjects

func (c *LongColumn) GetObjects() ([]interface{}, error)

func (*LongColumn) GetPositionCount

func (c *LongColumn) GetPositionCount() int32

func (*LongColumn) IsNull

func (c *LongColumn) IsNull(position int32) bool

func (*LongColumn) IsNulls

func (c *LongColumn) IsNulls() []bool

func (*LongColumn) MayHaveNull

func (c *LongColumn) MayHaveNull() bool

type MeasurementSchema

type MeasurementSchema struct {
	Measurement string
	DataType    TSDataType
}

type PoolConfig

type PoolConfig struct {
	Host            string
	Port            string
	NodeUrls        []string
	UserName        string
	Password        string
	FetchSize       int32
	TimeZone        string
	ConnectRetryMax int
	Database        string
	// contains filtered or unexported fields
}

type PooledTableSession

type PooledTableSession struct {
	// contains filtered or unexported fields
}

PooledTableSession represents a session managed within a TableSessionPool. It ensures proper cleanup and reusability of the session.

func (*PooledTableSession) Close

func (s *PooledTableSession) Close() error

Close closes the PooledTableSession, releasing it back to the pool.

Returns:

  • err: An error if there is an issue with session closure or cleanup.

func (*PooledTableSession) ExecuteNonQueryStatement

func (s *PooledTableSession) ExecuteNonQueryStatement(sql string) (r *common.TSStatus, err error)

ExecuteNonQueryStatement executes a non-query SQL statement, such as a DDL or DML command.

Parameters:

  • sql: The SQL statement to execute.

Returns:

  • r: A pointer to TSStatus indicating the execution result.
  • err: An error if an issue occurs during the operation.

func (*PooledTableSession) ExecuteQueryStatement

func (s *PooledTableSession) ExecuteQueryStatement(sql string, timeoutInMs *int64) (*SessionDataSet, error)

ExecuteQueryStatement executes a query SQL statement and returns the result set.

Parameters:

  • sql: The SQL query statement to execute.
  • timeoutInMs: A pointer to the timeout duration in milliseconds for query execution.

Returns:

  • result: A pointer to SessionDataSet containing the query results.
  • err: An error if an issue occurs during the operation.

func (*PooledTableSession) Insert

func (s *PooledTableSession) Insert(tablet *Tablet) (r *common.TSStatus, err error)

Insert inserts a Tablet into the database.

Parameters:

  • tablet: A pointer to a Tablet containing time-series data to be inserted.

Returns:

  • r: A pointer to TSStatus indicating the execution result.
  • err: An error if an issue occurs during the operation.

type RowRecord

type RowRecord struct {
	// contains filtered or unexported fields
}

func (*RowRecord) GetFields

func (r *RowRecord) GetFields() []*Field

func (*RowRecord) GetTimestamp

func (r *RowRecord) GetTimestamp() int64

type RunLengthColumnDecoder

type RunLengthColumnDecoder struct {
	// contains filtered or unexported fields
}

func (*RunLengthColumnDecoder) ReadColumn

func (decoder *RunLengthColumnDecoder) ReadColumn(reader *bytes.Reader, dataType TSDataType, positionCount int32) (Column, error)

type RunLengthEncodedColumn

type RunLengthEncodedColumn struct {
	// contains filtered or unexported fields
}

func NewRunLengthEncodedColumn

func NewRunLengthEncodedColumn(value Column, positionCount int32) (*RunLengthEncodedColumn, error)

func (*RunLengthEncodedColumn) GetBinaries

func (c *RunLengthEncodedColumn) GetBinaries() ([]*Binary, error)

func (*RunLengthEncodedColumn) GetBinary

func (c *RunLengthEncodedColumn) GetBinary(_ int32) (*Binary, error)

func (*RunLengthEncodedColumn) GetBoolean

func (c *RunLengthEncodedColumn) GetBoolean(_ int32) (bool, error)

func (*RunLengthEncodedColumn) GetBooleans

func (c *RunLengthEncodedColumn) GetBooleans() ([]bool, error)

func (*RunLengthEncodedColumn) GetDataType

func (c *RunLengthEncodedColumn) GetDataType() TSDataType

func (*RunLengthEncodedColumn) GetDouble

func (c *RunLengthEncodedColumn) GetDouble(_ int32) (float64, error)

func (*RunLengthEncodedColumn) GetDoubles

func (c *RunLengthEncodedColumn) GetDoubles() ([]float64, error)

func (*RunLengthEncodedColumn) GetEncoding

func (c *RunLengthEncodedColumn) GetEncoding() ColumnEncoding

func (*RunLengthEncodedColumn) GetFloat

func (c *RunLengthEncodedColumn) GetFloat(_ int32) (float32, error)

func (*RunLengthEncodedColumn) GetFloats

func (c *RunLengthEncodedColumn) GetFloats() ([]float32, error)

func (*RunLengthEncodedColumn) GetInt

func (c *RunLengthEncodedColumn) GetInt(_ int32) (int32, error)

func (*RunLengthEncodedColumn) GetInts

func (c *RunLengthEncodedColumn) GetInts() ([]int32, error)

func (*RunLengthEncodedColumn) GetLong

func (c *RunLengthEncodedColumn) GetLong(_ int32) (int64, error)

func (*RunLengthEncodedColumn) GetLongs

func (c *RunLengthEncodedColumn) GetLongs() ([]int64, error)

func (*RunLengthEncodedColumn) GetObject

func (c *RunLengthEncodedColumn) GetObject(_ int32) (interface{}, error)

func (*RunLengthEncodedColumn) GetObjects

func (c *RunLengthEncodedColumn) GetObjects() ([]interface{}, error)

func (*RunLengthEncodedColumn) GetPositionCount

func (c *RunLengthEncodedColumn) GetPositionCount() int32

func (*RunLengthEncodedColumn) GetValue

func (c *RunLengthEncodedColumn) GetValue() Column

func (*RunLengthEncodedColumn) IsNull

func (c *RunLengthEncodedColumn) IsNull(_ int32) bool

func (*RunLengthEncodedColumn) IsNulls

func (c *RunLengthEncodedColumn) IsNulls() []bool

func (*RunLengthEncodedColumn) MayHaveNull

func (c *RunLengthEncodedColumn) MayHaveNull() bool

type Session

type Session struct {
	// contains filtered or unexported fields
}

func NewClusterSession

func NewClusterSession(clusterConfig *ClusterConfig) (Session, error)

func NewSession

func NewSession(config *Config) Session

func (*Session) Close

func (s *Session) Close() error

func (*Session) CreateAlignedTimeseries

func (s *Session) CreateAlignedTimeseries(prefixPath string, measurements []string, dataTypes []TSDataType, encodings []TSEncoding, compressors []TSCompressionType, measurementAlias []string) (r *common.TSStatus, err error)

*create single aligned time series *params *prefixPath: string, time series prefix path (starts from root) *measurements: []string, sensor names *dataTypes: []int32, data types for time series *encodings: []int32, encodings for time series *compressors: []int32, compressing types for time series *measurementAlias: []string, sensor names alias *return *error: correctness of operation

func (*Session) CreateMultiTimeseries

func (s *Session) CreateMultiTimeseries(paths []string, dataTypes []TSDataType, encodings []TSEncoding, compressors []TSCompressionType) (r *common.TSStatus, err error)

*create multiple time series *params *paths: []string, complete time series paths (starts from root) *dataTypes: []int32, data types for time series *encodings: []int32, encodings for time series *compressors: []int32, compressing types for time series *return *error: correctness of operation

func (*Session) CreateTimeseries

func (s *Session) CreateTimeseries(path string, dataType TSDataType, encoding TSEncoding, compressor TSCompressionType, attributes map[string]string, tags map[string]string) (r *common.TSStatus, err error)

*create single time series *params *path: string, complete time series path (starts from root) *dataType: int32, data type for this time series *encoding: int32, data type for this time series *compressor: int32, compressing type for this time series *return *error: correctness of operation

func (*Session) DeleteData

func (s *Session) DeleteData(paths []string, startTime int64, endTime int64) (r *common.TSStatus, err error)

*delete all startTime <= data <= endTime in multiple time series *params *paths: []string, time series array that the data in *startTime: int64, start time of deletion range *endTime: int64, end time of deletion range *return *error: correctness of operation

func (*Session) DeleteStorageGroup

func (s *Session) DeleteStorageGroup(storageGroupId string) (r *common.TSStatus, err error)

*delete one storage group *param *storageGroupId: string, storage group name (starts from root) *return *error: correctness of operation

func (*Session) DeleteStorageGroups

func (s *Session) DeleteStorageGroups(storageGroupIds ...string) (r *common.TSStatus, err error)

*delete multiple storage group *param *storageGroupIds: []string, paths of the target storage groups *return *error: correctness of operation

func (*Session) DeleteTimeseries

func (s *Session) DeleteTimeseries(paths []string) (r *common.TSStatus, err error)

*delete multiple time series, including data and schema *params *paths: []string, time series paths, which should be complete (starts from root) *return *error: correctness of operation

func (*Session) ExecuteAggregationQuery

func (s *Session) ExecuteAggregationQuery(paths []string, aggregations []common.TAggregationType,
	startTime *int64, endTime *int64, interval *int64,
	timeoutMs *int64,
) (*SessionDataSet, error)

func (*Session) ExecuteAggregationQueryWithLegalNodes

func (s *Session) ExecuteAggregationQueryWithLegalNodes(paths []string, aggregations []common.TAggregationType,
	startTime *int64, endTime *int64, interval *int64,
	timeoutMs *int64, legalNodes *bool,
) (*SessionDataSet, error)

func (*Session) ExecuteBatchStatement

func (s *Session) ExecuteBatchStatement(inserts []string) (r *common.TSStatus, err error)

func (*Session) ExecuteNonQueryStatement

func (s *Session) ExecuteNonQueryStatement(sql string) (r *common.TSStatus, err error)

func (*Session) ExecuteQueryStatement

func (s *Session) ExecuteQueryStatement(sql string, timeoutMs *int64) (*SessionDataSet, error)

func (*Session) ExecuteRawDataQuery

func (s *Session) ExecuteRawDataQuery(paths []string, startTime int64, endTime int64) (*SessionDataSet, error)

func (*Session) ExecuteStatement

func (s *Session) ExecuteStatement(sql string) (*SessionDataSet, error)

func (*Session) ExecuteStatementWithContext

func (s *Session) ExecuteStatementWithContext(ctx context.Context, sql string) (*SessionDataSet, error)

func (*Session) ExecuteUpdateStatement

func (s *Session) ExecuteUpdateStatement(sql string) (*SessionDataSet, error)

func (*Session) GetSessionId

func (s *Session) GetSessionId() int64

func (*Session) GetTimeZone

func (s *Session) GetTimeZone() (string, error)

func (*Session) InsertAlignedRecord

func (s *Session) InsertAlignedRecord(deviceId string, measurements []string, dataTypes []TSDataType, values []interface{}, timestamp int64) (r *common.TSStatus, err error)

func (*Session) InsertAlignedRecords

func (s *Session) InsertAlignedRecords(deviceIds []string, measurements [][]string, dataTypes [][]TSDataType, values [][]interface{},
	timestamps []int64,
) (r *common.TSStatus, err error)

func (*Session) InsertAlignedRecordsOfOneDevice

func (s *Session) InsertAlignedRecordsOfOneDevice(deviceId string, timestamps []int64, measurementsSlice [][]string, dataTypesSlice [][]TSDataType, valuesSlice [][]interface{}, sorted bool) (r *common.TSStatus, err error)

func (*Session) InsertAlignedTablet

func (s *Session) InsertAlignedTablet(tablet *Tablet, sorted bool) (r *common.TSStatus, err error)

func (*Session) InsertAlignedTablets

func (s *Session) InsertAlignedTablets(tablets []*Tablet, sorted bool) (r *common.TSStatus, err error)

func (*Session) InsertRecord

func (s *Session) InsertRecord(deviceId string, measurements []string, dataTypes []TSDataType, values []interface{}, timestamp int64) (r *common.TSStatus, err error)

func (*Session) InsertRecords

func (s *Session) InsertRecords(deviceIds []string, measurements [][]string, dataTypes [][]TSDataType, values [][]interface{},
	timestamps []int64,
) (r *common.TSStatus, err error)

*insert multiple rows of data, records are independent to each other, in other words, there's no relationship *between those records * *params *deviceIds: []string, time series paths for device *measurements: [][]string, each element of outer list indicates measurements of a device *dataTypes: [][]int32, each element of outer list indicates sensor data types of a device *values: [][]interface{}, values to be inserted, for each device *timestamps: []int64, timestamps for records *

func (*Session) InsertRecordsOfOneDevice

func (s *Session) InsertRecordsOfOneDevice(deviceId string, timestamps []int64, measurementsSlice [][]string, dataTypesSlice [][]TSDataType, valuesSlice [][]interface{}, sorted bool) (r *common.TSStatus, err error)

InsertRecordsOfOneDevice Insert multiple rows, which can reduce the overhead of network. This method is just like jdbc executeBatch, we pack some insert request in batch and send them to server. If you want improve your performance, please see insertTablet method Each row is independent, which could have different insertTargetName, time, number of measurements

func (*Session) InsertStringRecord

func (s *Session) InsertStringRecord(deviceId string, measurements []string, values []string, timestamp int64) (r *common.TSStatus, err error)

*special case for inserting one row of String (TEXT) value *params *deviceId: string, time series path for device *measurements: []string, sensor names *values: []string, values to be inserted, for each sensor *timestamp: int64, indicate the timestamp of the row of data *return *error: correctness of operation

func (*Session) InsertTablet

func (s *Session) InsertTablet(tablet *Tablet, sorted bool) (r *common.TSStatus, err error)

func (*Session) InsertTablets

func (s *Session) InsertTablets(tablets []*Tablet, sorted bool) (r *common.TSStatus, err error)

* InsertTablets insert multiple tablets, tablets are independent to each other *params *tablets: []*client.Tablet, list of tablets

func (*Session) Open

func (s *Session) Open(enableRPCCompression bool, connectionTimeoutInMs int) error

func (*Session) OpenCluster

func (s *Session) OpenCluster(enableRPCCompression bool) error

func (*Session) SetFetchSize

func (s *Session) SetFetchSize(fetchSize int32)

func (*Session) SetStorageGroup

func (s *Session) SetStorageGroup(storageGroupId string) (r *common.TSStatus, err error)

*set one storage group *param *storageGroupId: string, storage group name (starts from root) *return *error: correctness of operation

func (*Session) SetTimeZone

func (s *Session) SetTimeZone(timeZone string) (r *common.TSStatus, err error)

type SessionDataSet

type SessionDataSet struct {
	// contains filtered or unexported fields
}

func NewSessionDataSet

func NewSessionDataSet(sql string, columnNameList []string, columnTypeList []string, columnNameIndex map[string]int32, queryId int64, statementId int64, client *rpc.IClientRPCServiceClient, sessionId int64, queryResult [][]byte, ignoreTimestamp bool, timeout *int64, moreData bool, fetchSize int32, zoneId string, timeFactor int32, columnIndex2TsBlockColumnIndexList []int32) (*SessionDataSet, error)

func (*SessionDataSet) Close

func (s *SessionDataSet) Close() error

func (*SessionDataSet) FindColumn

func (s *SessionDataSet) FindColumn(columnName string) int32

func (*SessionDataSet) GetBlob

func (s *SessionDataSet) GetBlob(columnName string) (*Binary, error)

func (*SessionDataSet) GetBlobByIndex

func (s *SessionDataSet) GetBlobByIndex(columnIndex int32) (*Binary, error)

func (*SessionDataSet) GetBoolean

func (s *SessionDataSet) GetBoolean(columnName string) (bool, error)

func (*SessionDataSet) GetBooleanByIndex

func (s *SessionDataSet) GetBooleanByIndex(columnIndex int32) (bool, error)

func (*SessionDataSet) GetColumnNames

func (s *SessionDataSet) GetColumnNames() []string

func (*SessionDataSet) GetColumnTypes

func (s *SessionDataSet) GetColumnTypes() []string

func (*SessionDataSet) GetDate

func (s *SessionDataSet) GetDate(columnName string) (time.Time, error)

func (*SessionDataSet) GetDateByIndex

func (s *SessionDataSet) GetDateByIndex(columnIndex int32) (time.Time, error)

func (*SessionDataSet) GetDouble

func (s *SessionDataSet) GetDouble(columnName string) (float64, error)

func (*SessionDataSet) GetDoubleByIndex

func (s *SessionDataSet) GetDoubleByIndex(columnIndex int32) (float64, error)

func (*SessionDataSet) GetFloat

func (s *SessionDataSet) GetFloat(columnName string) (float32, error)

func (*SessionDataSet) GetFloatByIndex

func (s *SessionDataSet) GetFloatByIndex(columnIndex int32) (float32, error)

func (*SessionDataSet) GetInt

func (s *SessionDataSet) GetInt(columnName string) (int32, error)

func (*SessionDataSet) GetIntByIndex

func (s *SessionDataSet) GetIntByIndex(columnIndex int32) (int32, error)

func (*SessionDataSet) GetLong

func (s *SessionDataSet) GetLong(columnName string) (int64, error)

func (*SessionDataSet) GetLongByIndex

func (s *SessionDataSet) GetLongByIndex(columnIndex int32) (int64, error)

func (*SessionDataSet) GetObject

func (s *SessionDataSet) GetObject(columnName string) (interface{}, error)

func (*SessionDataSet) GetObjectByIndex

func (s *SessionDataSet) GetObjectByIndex(columnIndex int32) (interface{}, error)

func (*SessionDataSet) GetString

func (s *SessionDataSet) GetString(columnName string) (string, error)

func (*SessionDataSet) GetStringByIndex

func (s *SessionDataSet) GetStringByIndex(columnIndex int32) (string, error)

func (*SessionDataSet) GetTimestamp

func (s *SessionDataSet) GetTimestamp(columnName string) (time.Time, error)

func (*SessionDataSet) GetTimestampByIndex

func (s *SessionDataSet) GetTimestampByIndex(columnIndex int32) (time.Time, error)

func (*SessionDataSet) IsNull

func (s *SessionDataSet) IsNull(columnName string) (bool, error)

func (*SessionDataSet) IsNullByIndex

func (s *SessionDataSet) IsNullByIndex(columnIndex int32) (bool, error)

func (*SessionDataSet) Next

func (s *SessionDataSet) Next() (bool, error)

type SessionPool

type SessionPool struct {
	// contains filtered or unexported fields
}

func NewSessionPool

func NewSessionPool(conf *PoolConfig, maxSize, connectionTimeoutInMs, waitToGetSessionTimeoutInMs int,
	enableCompression bool) SessionPool

func (*SessionPool) Close

func (spool *SessionPool) Close()

func (*SessionPool) ConstructSession

func (spool *SessionPool) ConstructSession(config *PoolConfig) (session Session, err error)

func (*SessionPool) GetSession

func (spool *SessionPool) GetSession() (session Session, err error)

func (*SessionPool) PutBack

func (spool *SessionPool) PutBack(session Session)

type TSCompressionType

type TSCompressionType uint8
const (
	UNCOMPRESSED TSCompressionType = 0
	SNAPPY       TSCompressionType = 1
	GZIP         TSCompressionType = 2
	LZ4          TSCompressionType = 7
	ZSTD         TSCompressionType = 8
	LZMA2        TSCompressionType = 9
)

type TSDataType

type TSDataType int8
const (
	UNKNOWN   TSDataType = -1
	BOOLEAN   TSDataType = 0
	INT32     TSDataType = 1
	INT64     TSDataType = 2
	FLOAT     TSDataType = 3
	DOUBLE    TSDataType = 4
	TEXT      TSDataType = 5
	TIMESTAMP TSDataType = 8
	DATE      TSDataType = 9
	BLOB      TSDataType = 10
	STRING    TSDataType = 11
)

func GetDataTypeByStr

func GetDataTypeByStr(name string) (TSDataType, error)

type TSEncoding

type TSEncoding uint8
const (
	PLAIN      TSEncoding = 0
	DICTIONARY TSEncoding = 1
	RLE        TSEncoding = 2
	DIFF       TSEncoding = 3
	TS_2DIFF   TSEncoding = 4
	BITMAP     TSEncoding = 5
	GORILLA_V1 TSEncoding = 6
	REGULAR    TSEncoding = 7
	GORILLA    TSEncoding = 8
	ZIGZAG     TSEncoding = 9
	FREQ       TSEncoding = 10
	CHIMP      TSEncoding = 11
	SPRINTZ    TSEncoding = 12
	RLBE       TSEncoding = 13
)

type TableSession

type TableSession struct {
	// contains filtered or unexported fields
}

TableSession represents a session for interacting with IoTDB in relational mode. It wraps a Session instance, providing methods for executing SQL statements and managing the lifecycle of the session.

func (*TableSession) Close

func (s *TableSession) Close() error

Close closes the TableSession, releasing any associated resources.

Returns:

  • err: An error if the session fails to close properly.

func (*TableSession) ExecuteNonQueryStatement

func (s *TableSession) ExecuteNonQueryStatement(sql string) (r *common.TSStatus, err error)

ExecuteNonQueryStatement executes a non-query SQL statement, such as a DDL or DML command.

Parameters:

  • sql: The SQL statement to be executed.

Returns:

  • r: A pointer to TSStatus indicating the execution result.
  • err: An error if the operation fails.

func (*TableSession) ExecuteQueryStatement

func (s *TableSession) ExecuteQueryStatement(sql string, timeoutInMs *int64) (*SessionDataSet, error)

ExecuteQueryStatement executes a query SQL statement and retrieves the result set.

Parameters:

  • sql: The SQL query to be executed.
  • timeoutInMs: (Optional) A pointer to the timeout duration in milliseconds for the query.

Returns:

  • result: A pointer to SessionDataSet containing the query results.
  • err: An error if the operation fails.

func (*TableSession) Insert

func (s *TableSession) Insert(tablet *Tablet) (r *common.TSStatus, err error)

Insert inserts a Tablet into the IoTDB.

Parameters:

  • tablet: A pointer to a Tablet containing the data to be inserted.

Returns:

  • r: A pointer to TSStatus indicating the execution result.
  • err: An error if the operation fails.

type TableSessionPool

type TableSessionPool struct {
	// contains filtered or unexported fields
}

TableSessionPool manages a pool of ITableSession instances, enabling efficient reuse and management of resources. It provides methods to acquire a session from the pool and to close the pool, releasing all held resources.

This implementation ensures proper lifecycle management of sessions, including efficient reuse and cleanup of resources.

func NewTableSessionPool

func NewTableSessionPool(conf *PoolConfig, maxSize, connectionTimeoutInMs, waitToGetSessionTimeoutInMs int,
	enableCompression bool) TableSessionPool

NewTableSessionPool creates a new TableSessionPool with the specified configuration.

Parameters:

  • conf: PoolConfig defining the configuration for the pool.
  • maxSize: The maximum number of sessions the pool can hold.
  • connectionTimeoutInMs: Timeout for establishing a connection in milliseconds.
  • waitToGetSessionTimeoutInMs: Timeout for waiting to acquire a session in milliseconds.
  • enableCompression: A boolean indicating whether to enable compression.

Returns:

  • A TableSessionPool instance.

func (*TableSessionPool) Close

func (spool *TableSessionPool) Close()

Close closes the TableSessionPool, releasing all held resources. Once closed, no further sessions can be acquired from the pool.

func (*TableSessionPool) GetSession

func (spool *TableSessionPool) GetSession() (ITableSession, error)

GetSession acquires an ITableSession instance from the pool.

Returns:

  • A usable ITableSession instance for interacting with IoTDB.
  • An error if a session cannot be acquired.

type Tablet

type Tablet struct {
	RowSize int
	// contains filtered or unexported fields
}

func NewRelationalTablet

func NewRelationalTablet(tableName string, measurementSchemas []*MeasurementSchema, columnCategories []ColumnCategory, maxRowNumber int) (*Tablet, error)

func NewTablet

func NewTablet(insertTargetName string, measurementSchemas []*MeasurementSchema, maxRowNumber int) (*Tablet, error)

func (*Tablet) GetMaxRowNumber

func (t *Tablet) GetMaxRowNumber() int

func (*Tablet) GetMeasurements

func (t *Tablet) GetMeasurements() []string

func (*Tablet) GetTimestampBytes

func (t *Tablet) GetTimestampBytes() []byte

func (*Tablet) GetValueAt

func (t *Tablet) GetValueAt(columnIndex, rowIndex int) (interface{}, error)

func (*Tablet) Len

func (t *Tablet) Len() int

func (*Tablet) Less

func (t *Tablet) Less(i, j int) bool

func (*Tablet) Reset

func (t *Tablet) Reset()

func (*Tablet) SetTimestamp

func (t *Tablet) SetTimestamp(timestamp int64, rowIndex int)

func (*Tablet) SetValueAt

func (t *Tablet) SetValueAt(value interface{}, columnIndex, rowIndex int) error

func (*Tablet) Sort

func (t *Tablet) Sort() error

func (*Tablet) Swap

func (t *Tablet) Swap(i, j int)

type TimeColumn

type TimeColumn struct {
	// contains filtered or unexported fields
}

func NewTimeColumn

func NewTimeColumn(arrayOffset int32, positionCount int32, values []int64) (*TimeColumn, error)

func (*TimeColumn) GetBinaries

func (c *TimeColumn) GetBinaries() ([]*Binary, error)

func (*TimeColumn) GetBinary

func (c *TimeColumn) GetBinary(_ int32) (*Binary, error)

func (*TimeColumn) GetBoolean

func (c *TimeColumn) GetBoolean(_ int32) (bool, error)

func (*TimeColumn) GetBooleans

func (c *TimeColumn) GetBooleans() ([]bool, error)

func (*TimeColumn) GetDataType

func (tc *TimeColumn) GetDataType() TSDataType

func (*TimeColumn) GetDouble

func (c *TimeColumn) GetDouble(_ int32) (float64, error)

func (*TimeColumn) GetDoubles

func (c *TimeColumn) GetDoubles() ([]float64, error)

func (*TimeColumn) GetEncoding

func (tc *TimeColumn) GetEncoding() ColumnEncoding

func (*TimeColumn) GetEndTime

func (tc *TimeColumn) GetEndTime() int64

func (*TimeColumn) GetFloat

func (c *TimeColumn) GetFloat(_ int32) (float32, error)

func (*TimeColumn) GetFloats

func (c *TimeColumn) GetFloats() ([]float32, error)

func (*TimeColumn) GetInt

func (c *TimeColumn) GetInt(_ int32) (int32, error)

func (*TimeColumn) GetInts

func (c *TimeColumn) GetInts() ([]int32, error)

func (*TimeColumn) GetLong

func (tc *TimeColumn) GetLong(position int32) (int64, error)

func (*TimeColumn) GetLongs

func (tc *TimeColumn) GetLongs() ([]int64, error)

func (*TimeColumn) GetObject

func (c *TimeColumn) GetObject(_ int32) (interface{}, error)

func (*TimeColumn) GetObjects

func (c *TimeColumn) GetObjects() ([]interface{}, error)

func (*TimeColumn) GetPositionCount

func (tc *TimeColumn) GetPositionCount() int32

func (*TimeColumn) GetStartTime

func (tc *TimeColumn) GetStartTime() int64

func (*TimeColumn) GetTimes

func (tc *TimeColumn) GetTimes() []int64

func (*TimeColumn) IsNull

func (tc *TimeColumn) IsNull(_ int32) bool

func (*TimeColumn) IsNulls

func (tc *TimeColumn) IsNulls() []bool

func (*TimeColumn) MayHaveNull

func (tc *TimeColumn) MayHaveNull() bool

type TsBlock

type TsBlock struct {
	// contains filtered or unexported fields
}

func DeserializeTsBlock

func DeserializeTsBlock(data []byte) (*TsBlock, error)

func NewTsBlock

func NewTsBlock(positionCount int32, timeColumn Column, valueColumns ...Column) (*TsBlock, error)

func (*TsBlock) GetColumn

func (t *TsBlock) GetColumn(columnIndex int32) Column

func (*TsBlock) GetEndTime

func (t *TsBlock) GetEndTime() (int64, error)

func (*TsBlock) GetPositionCount

func (t *TsBlock) GetPositionCount() int32

func (*TsBlock) GetStartTime

func (t *TsBlock) GetStartTime() (int64, error)

func (*TsBlock) GetTimeByIndex

func (t *TsBlock) GetTimeByIndex(index int32) (int64, error)

func (*TsBlock) GetTimeColumn

func (t *TsBlock) GetTimeColumn() Column

func (*TsBlock) GetValueColumnCount

func (t *TsBlock) GetValueColumnCount() int32

func (*TsBlock) GetValueColumns

func (t *TsBlock) GetValueColumns() *[]Column

func (*TsBlock) IsEmpty

func (t *TsBlock) IsEmpty() bool

type Version

type Version string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL