Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
Iotdb
提交
ec72e4e0
I
Iotdb
项目概览
apache
/
Iotdb
大约 1 年 前同步成功
通知
25
Star
3344
Fork
916
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
I
Iotdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
ec72e4e0
编写于
5月 11, 2019
作者:
Z
Zhang.Jinrui
提交者:
GitHub
5月 11, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #173 from LeiRui/master
fix a bug in TsFile-Spark-Connector
上级
3568b322
bf62685f
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
8 addition
and
5 deletion
+8
-5
spark/src/main/scala/org/apache/iotdb/tsfile/Converter.scala
spark/src/main/scala/org/apache/iotdb/tsfile/Converter.scala
+7
-5
tsfile/src/main/java/org/apache/iotdb/tsfile/common/constant/QueryConstant.java
...rg/apache/iotdb/tsfile/common/constant/QueryConstant.java
+1
-0
未找到文件。
spark/src/main/scala/org/apache/iotdb/tsfile/Converter.scala
浏览文件 @
ec72e4e0
...
@@ -238,9 +238,9 @@ object Converter {
...
@@ -238,9 +238,9 @@ object Converter {
*/
*/
def
getTsDataType
(
dataType
:
DataType
)
:
TSDataType
=
{
def
getTsDataType
(
dataType
:
DataType
)
:
TSDataType
=
{
dataType
match
{
dataType
match
{
case
BooleanType
=>
TSDataType
.
BOOLEAN
case
IntegerType
=>
TSDataType
.
INT32
case
IntegerType
=>
TSDataType
.
INT32
case
LongType
=>
TSDataType
.
INT64
case
LongType
=>
TSDataType
.
INT64
case
BooleanType
=>
TSDataType
.
BOOLEAN
case
FloatType
=>
TSDataType
.
FLOAT
case
FloatType
=>
TSDataType
.
FLOAT
case
DoubleType
=>
TSDataType
.
DOUBLE
case
DoubleType
=>
TSDataType
.
DOUBLE
case
StringType
=>
TSDataType
.
TEXT
case
StringType
=>
TSDataType
.
TEXT
...
@@ -259,6 +259,7 @@ object Converter {
...
@@ -259,6 +259,7 @@ object Converter {
val
conf
=
TSFileDescriptor
.
getInstance
.
getConfig
val
conf
=
TSFileDescriptor
.
getInstance
.
getConfig
val
dataType
=
getTsDataType
(
field
.
dataType
)
val
dataType
=
getTsDataType
(
field
.
dataType
)
val
encodingStr
=
dataType
match
{
val
encodingStr
=
dataType
match
{
case
TSDataType
.
BOOLEAN
=>
options
.
getOrElse
(
QueryConstant
.
BOOLEAN
,
TSEncoding
.
PLAIN
.
toString
)
case
TSDataType
.
INT32
=>
options
.
getOrElse
(
QueryConstant
.
INT32
,
TSEncoding
.
RLE
.
toString
)
case
TSDataType
.
INT32
=>
options
.
getOrElse
(
QueryConstant
.
INT32
,
TSEncoding
.
RLE
.
toString
)
case
TSDataType
.
INT64
=>
options
.
getOrElse
(
QueryConstant
.
INT64
,
TSEncoding
.
RLE
.
toString
)
case
TSDataType
.
INT64
=>
options
.
getOrElse
(
QueryConstant
.
INT64
,
TSEncoding
.
RLE
.
toString
)
case
TSDataType
.
FLOAT
=>
options
.
getOrElse
(
QueryConstant
.
FLOAT
,
TSEncoding
.
RLE
.
toString
)
case
TSDataType
.
FLOAT
=>
options
.
getOrElse
(
QueryConstant
.
FLOAT
,
TSEncoding
.
RLE
.
toString
)
...
@@ -317,6 +318,7 @@ object Converter {
...
@@ -317,6 +318,7 @@ object Converter {
val
index
=
row
.
fieldIndex
(
name
)
val
index
=
row
.
fieldIndex
(
name
)
if
(!
row
.
isNullAt
(
index
))
{
if
(!
row
.
isNullAt
(
index
))
{
val
value
=
f
.
dataType
match
{
val
value
=
f
.
dataType
match
{
case
BooleanType
=>
row
.
getAs
[
Boolean
](
name
)
case
IntegerType
=>
row
.
getAs
[
Int
](
name
)
case
IntegerType
=>
row
.
getAs
[
Int
](
name
)
case
LongType
=>
row
.
getAs
[
Long
](
name
)
case
LongType
=>
row
.
getAs
[
Long
](
name
)
case
FloatType
=>
row
.
getAs
[
Float
](
name
)
case
FloatType
=>
row
.
getAs
[
Float
](
name
)
...
@@ -468,6 +470,10 @@ object Converter {
...
@@ -468,6 +470,10 @@ object Converter {
filterType
match
{
filterType
match
{
case
FilterTypes
.
Eq
=>
case
FilterTypes
.
Eq
=>
dataType
match
{
dataType
match
{
case
BooleanType
=>
val
filter
=
new
SingleSeriesExpression
(
new
Path
(
nodeName
),
ValueFilter
.
eq
(
nodeValue
.
asInstanceOf
[
java.lang.Boolean
]))
filter
case
IntegerType
=>
case
IntegerType
=>
val
filter
=
new
SingleSeriesExpression
(
new
Path
(
nodeName
),
val
filter
=
new
SingleSeriesExpression
(
new
Path
(
nodeName
),
ValueFilter
.
eq
(
nodeValue
.
asInstanceOf
[
java.lang.Integer
]))
ValueFilter
.
eq
(
nodeValue
.
asInstanceOf
[
java.lang.Integer
]))
...
@@ -488,10 +494,6 @@ object Converter {
...
@@ -488,10 +494,6 @@ object Converter {
val
filter
=
new
SingleSeriesExpression
(
new
Path
(
nodeName
),
val
filter
=
new
SingleSeriesExpression
(
new
Path
(
nodeName
),
ValueFilter
.
eq
(
new
Binary
(
nodeValue
.
toString
)))
ValueFilter
.
eq
(
new
Binary
(
nodeValue
.
toString
)))
filter
filter
case
BooleanType
=>
val
filter
=
new
SingleSeriesExpression
(
new
Path
(
nodeName
),
ValueFilter
.
eq
(
nodeValue
.
asInstanceOf
[
java.lang.Boolean
]))
filter
case
other
=>
throw
new
UnsupportedOperationException
(
s
"Unsupported type $other"
)
case
other
=>
throw
new
UnsupportedOperationException
(
s
"Unsupported type $other"
)
}
}
case
FilterTypes
.
Gt
=>
case
FilterTypes
.
Gt
=>
...
...
tsfile/src/main/java/org/apache/iotdb/tsfile/common/constant/QueryConstant.java
浏览文件 @
ec72e4e0
...
@@ -27,6 +27,7 @@ public class QueryConstant {
...
@@ -27,6 +27,7 @@ public class QueryConstant {
public
static
final
String
RESERVED_TIME
=
"time"
;
public
static
final
String
RESERVED_TIME
=
"time"
;
public
static
final
String
BOOLEAN
=
"BOOLEAN"
;
public
static
final
String
INT32
=
"INT32"
;
public
static
final
String
INT32
=
"INT32"
;
public
static
final
String
INT64
=
"INT64"
;
public
static
final
String
INT64
=
"INT64"
;
public
static
final
String
FLOAT
=
"FLOAT"
;
public
static
final
String
FLOAT
=
"FLOAT"
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录