Phoenix学习笔记 --- phoenix支持的数据类型
2016-12-08 14:28
549 查看
Data Types
Index
INTEGER Type
INTEGER
Possible values: -2147483648 to 2147483647.
Mapped to
java.lang.Integer. The binary
representation is a 4 byte integer with the sign bit flipped (so that negative values sorts before positive values).
Example:
INTEGER
UNSIGNED_INT Type
UNSIGNED_INT
Possible values: 0 to 2147483647. Mapped to
java.lang.Integer.
The binary representation is a 4 byte integer, matching the
HBaseBytes.toBytes(int)
method. The purpose of this type is to map to existing
HBasedata
that was serialized using this
HBaseutility
method. If that is not the case, use the regular signed type instead.
Example:
UNSIGNED_INT
BIGINT Type
BIGINT
Possible values: -9223372036854775807 to 9223372036854775807. Mapped to
java.lang.Long.
The binary representation is an 8 byte long with the sign bit flipped (so that negative values sorts before positive values).
Example:
BIGINT
UNSIGNED_LONG Type
UNSIGNED_LONG
Possible values: 0 to 9223372036854775807. Mapped to
java.lang.Long.
The binary representation is an 8 byte integer, matching the
HBaseBytes.toBytes(long)
method. The purpose of this type is to map to existing
HBasedata
that was serialized using this
HBaseutility
method. If that is not the case, use the regular signed type instead.
Example:
UNSIGNED_LONG
TINYINT Type
TINYINT
Possible values: -128 to 127. Mapped to
java.lang.Byte.
The binary representation is a single byte, with the sign bit flipped (so that negative values sorts before positive values).
Example:
TINYINT
UNSIGNED_TINYINT Type
UNSIGNED_TINYINT
Possible values: 0 to 127. Mapped to
java.lang.Byte.
The binary representation is a single byte, matching the
HBaseBytes.toBytes(byte)
method. The purpose of this type is to map to existing
HBasedata
that was serialized using this
HBaseutility
method. If that is not the case, use the regular signed type instead.
Example:
UNSIGNED_TINYINT
SMALLINT Type
SMALLINT
Possible values: -32768 to 32767. Mapped to
java.lang.Short.
The binary representation is a 2 byte short with the sign bit flipped (so that negative values sort before positive values).
Example:
SMALLINT
UNSIGNED_SMALLINT Type
UNSIGNED_SMALLINT
Possible values: 0 to 32767. Mapped to
java.lang.Short.
The binary representation is an 2 byte integer, matching the
HBaseBytes.toBytes(short)
method. The purpose of this type is to map to existing
HBasedata
that was serialized using this
HBaseutility
method. If that is not the case, use the regular signed type instead.
Example:
UNSIGNED_SMALLINT
FLOAT Type
FLOAT
Possible values: -3.402823466 E + 38 to 3.402823466 E + 38. Mapped to
java.lang.Float.
The binary representation is an 4 byte float with the sign bit flipped (so that negative values sort before positive values).
Example:
FLOAT
UNSIGNED_FLOAT Type
UNSIGNED_FLOAT
Possible values: 0 to 3.402823466 E + 38. Mapped to
java.lang.Float.
The binary representation is an 4 byte float matching the
HBaseBytes.toBytes(float)
method. The purpose of this type is to map to existing
HBasedata
that was serialized using this
HBaseutility
method. If that is not the case, use the regular signed type instead.
Example:
UNSIGNED_FLOAT
DOUBLE Type
DOUBLE
Possible values: -1.7976931348623158 E + 308 to 1.7976931348623158 E + 308. Mapped to
java.lang.Double.
The binary representation is an 8 byte double with the sign bit flipped (so that negative values sort before positive value).
Example:
DOUBLE
UNSIGNED_DOUBLE Type
UNSIGNED_DOUBLE
Possible values: 0 to 1.7976931348623158 E + 308. Mapped to
java.lang.Double.
The binary representation is an 8 byte double matching the
HBaseBytes.toBytes(double)
method. The purpose of this type is to map to existing
HBasedata
that was serialized using this
HBaseutility
method. If that is not the case, use the regular signed type instead.
Example:
UNSIGNED_DOUBLE
DECIMAL Type
DECIMAL |
|
DECIMAL(precision,scale)
in a
DDLstatement, for example,
DECIMAL(10,2).
The maximum precision is 38 digits. Mapped to
java.math.BigDecimal.
The binary representation is binary comparable, variable length format. When used in a row key, it is terminated with a null byte unless it is the last column.
Example:
DECIMAL
DECIMAL(10,2)
BOOLEAN Type
BOOLEAN
Possible values:
TRUEand
FALSE.
Mapped to
java.lang.Boolean. The binary
representation is a single byte with 0 for false and 1 for true
Example:
BOOLEAN
TIME Type
TIME
The time data type. The format is yyyy-
MM-dd
hh:mm:ss, with both the date and time parts maintained. Mapped to
java.sql.Time.
The binary representation is an 8 byte long (the number of milliseconds from the epoch), making it possible (although not necessarily recommended) to store more information within a
TIMEcolumn
than what is provided by
java.sql.Time.
Note that the internal representation is based on a number of milliseconds since the epoch (which is based on a time in
GMT),
while
java.sql.Timewill format times
based on the client's local time zone. Please note that this
TIMEtype
is different than the
TIMEtype as
defined by the SQL 92 standard in that it includes year, month, and day components. As such, it is not in compliance with the
JDBC APIs. As the underlying data is still stored as a long, only the presentation of the value is incorrect.
Example:
TIME
DATE Type
DATE
The date data type. The format is yyyy-
MM-dd
hh:mm:ss, with both the date and time parts maintained to a millisecond accuracy. Mapped to
java.sql.Date.
The binary representation is an 8 byte long (the number of milliseconds from the epoch), making it possible (although not necessarily recommended) to store more information within a
DATEcolumn
than what is provided by
java.sql.Date.
Note that the internal representation is based on a number of milliseconds since the epoch (which is based on a time in
GMT),
while
java.sql.Datewill format dates
based on the client's local time zone. Please note that this
DATEtype
is different than the
DATEtype as
defined by the SQL 92 standard in that it includes a time component. As such, it is not in compliance with the
JDBC APIs. As the underlying data is still stored as a long, only the presentation of the value is incorrect.
Example:
DATE
TIMESTAMP Type
TIMESTAMP
The timestamp data type. The format is yyyy-
MM-dd
hh:mm:ss[.nnnnnnnnn]. Mapped to
java.sql.Timestampwith
an internal representation of the number of nanos from the epoch. The binary representation is 12 bytes: an 8 byte long for the epoch time plus a 4 byte integer for the nanos. Note that the internal representation is based on a number of milliseconds since
the epoch (which is based on a time in
GMT),
while
java.sql.Timestampwill format
timestamps based on the client's local time zone.
Example:
TIMESTAMP
UNSIGNED_TIME Type
UNSIGNED_TIME
The unsigned time data type. The format is yyyy-
MM-dd
hh:mm:ss, with both the date and time parts maintained to the millisecond accuracy. Mapped to
java.sql.Time.
The binary representation is an 8 byte long (the number of milliseconds from the epoch) matching the
HBase.toBytes(long)
method. The purpose of this type is to map to existing
HBasedata
that was serialized using this
HBaseutility
method. If that is not the case, use the regular signed type instead.
Example:
UNSIGNED_TIME
UNSIGNED_DATE Type
UNSIGNED_DATE
The unsigned date data type. The format is yyyy-
MM-dd
hh:mm:ss, with both the date and time parts maintained to a millisecond accuracy. Mapped to
java.sql.Date.
The binary representation is an 8 byte long (the number of milliseconds from the epoch) matching the
HBase.toBytes(long)
method. The purpose of this type is to map to existing
HBasedata
that was serialized using this
HBaseutility
method. If that is not the case, use the regular signed type instead.
Example:
UNSIGNED_DATE
UNSIGNED_TIMESTAMP Type
UNSIGNED_TIMESTAMP
The timestamp data type. The format is yyyy-
MM-dd
hh:mm:ss[.nnnnnnnnn]. Mapped to
java.sql.Timestampwith
an internal representation of the number of nanos from the epoch. The binary representation is 12 bytes: an 8 byte long for the epoch time plus a 4 byte integer for the nanos with the long serialized through the
HBase.toBytes(long)
method. The purpose of this type is to map to existing
HBasedata
that was serialized using this
HBaseutility
method. If that is not the case, use the regular signed type instead.
Example:
UNSIGNED_TIMESTAMP
VARCHAR Type
VARCHAR |
|
UTF8matching
the
HBaseBytes.toBytes(String) method.
When used in a row key, it is terminated with a null byte unless it is the last column.
Mapped to
java.lang.String.
Example:
VARCHAR
VARCHAR(255)
CHAR Type
CHAR ( precisionInt ) |
UTF8matching
the
HBaseBytes.toBytes(String) method.
Mapped to
java.lang.String.
Example:
CHAR(10)
BINARY Type
BINARY ( precisionInt ) |
Mapped to
byte[].
Example:
BINARY
VARBINARY Type
VARBINARY
Raw variable length byte array.
Mapped to
byte[].
Example:
VARBINARY
ARRAY
ARRAY |
|
java.sql.Array. Every primitive
type except for
VARBINARYmay be declared
as an
ARRAY. Only single dimensional
arrays are supported.
Example:
VARCHAR ARRAY
CHAR(10) ARRAY [5]
INTEGER []
INTEGER [100]
==============================================================================================
支持的类型如下:
INTEGER 整形
UNSIGNED_INT 无符号整形
BIGINT 长整形
UNSIGNED_LONG 无符号长整形
TINYINT 短整形
UNSIGNED_TINYINT 无符号短整型
SMALLINT 小整形
UNSIGNED_SMALLINT 无符号短整型
FLOAT 浮点型
UNSIGNED_FLOAT 无符号浮点型
DOUBLE 双精度浮点型
UNSIGNED_DOUBLE 无符号双精度浮点型
DECIMAL 长精度双精度浮点型
BOOLEAN 布尔类型
TIME 时间类型
DATE 日期类型
TIMESTAMP 时间戳类型
UNSIGNED_TIME 无符号时间类型
UNSIGNED_DATE 无符号日期类型
UNSIGNED_TIMESTAMP 无符号时间戳类型
VARCHAR 字符串类型
CHAR 字符类型
BINARY 二进制类型
VARBINARY 可变长二进制类型
ARRAY 数组类型
相关文章推荐
- WebService学习笔记-CXF支持的数据类型
- PHP入门学习笔记之—— PHP支持的数据类型
- WebService学习笔记-CXF支持的数据类型
- ARM学习笔记(五)--ARM编译器支持的数据类型及预定义宏
- WCF学习笔记:传递DataTable 报错是因为WCF不支持DataTable数据类型,DataContractSerializer 支持的类型
- Visual C++ 学习笔记( 二 ) 基本数据类型与输入输出 (转rockybug)
- SQL Server 2005 T-SQL 学习笔记:新数据类型
- php学习笔记(3):PHP基本语法和数据类型:
- Java学习笔记---2.Java标识符和基本数据类型
- java学习笔记三(Java数据类型)
- Javascript学习笔记(二)Javascript核心之数据类型与值
- 学习笔记二-----数据类型
- C#学习笔记: 数据类型的一些说明
- MySQL学习笔记(八)―― MySQL的数据类型(日期型)
- C++ primer 数据类型的学习笔记
- PL/SQL学习笔记-常量变量及数据类型初步
- Oracle 基本数据类型 - Oracle 学习笔记 2
- MySQL学习笔记(九)―― MySQL的数据类型(复合型)
- FlashCS3学习笔记5-数据类型
- WinApi学习笔记-简单的数据类型