[GitHub] [iotdb-client-go] jixuan1989 merged pull request #14: fix sortTablet bug

2021-02-22 Thread GitBox


jixuan1989 merged pull request #14:
URL: https://github.com/apache/iotdb-client-go/pull/14


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [iotdb-client-go] jixuan1989 commented on pull request #14: fix sortTablet bug

2021-02-22 Thread GitBox


jixuan1989 commented on pull request #14:
URL: https://github.com/apache/iotdb-client-go/pull/14#issuecomment-783947096


   Thanks for the contribution @yanhongwangg @manlge . Will merge this.



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [iotdb-client-go] yanhongwangg commented on pull request #14: fix sortTablet bug

2021-02-22 Thread GitBox


yanhongwangg commented on pull request #14:
URL: https://github.com/apache/iotdb-client-go/pull/14#issuecomment-783325351


   > LGTM
   
   Thanks for your guidance



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [iotdb-client-go] manlge commented on pull request #14: fix sortTablet bug

2021-02-22 Thread GitBox


manlge commented on pull request #14:
URL: https://github.com/apache/iotdb-client-go/pull/14#issuecomment-783322102


   LGTM



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [iotdb-client-go] manlge commented on a change in pull request #14: fix sortTablet bug

2021-02-22 Thread GitBox


manlge commented on a change in pull request #14:
URL: https://github.com/apache/iotdb-client-go/pull/14#discussion_r580156781



##
File path: client/tablet.go
##
@@ -209,77 +250,20 @@ func (t *Tablet) getValuesBytes() ([]byte, error) {
 }
 
 func (t *Tablet) Sort() error {
-   var timeIndexs = make(map[int64]int, t.rowCount)
-   for index := range t.timestamps {
-   timeIndexs[t.timestamps[index]] = index
-   }
-   var keys []int64
-   for timeValue := range timeIndexs {
-   keys = append(keys, timeValue)
-   }
-   sort.Slice(keys, func(i, j int) bool { return keys[i] < keys[j] })
-   t.timestamps = keys
-   for index := range t.values {
-   sortValue, _ := sortList(t.values[index], 
t.getDataTypes()[index], timeIndexs, t.timestamps)
-   if sortValue != nil {
-   t.values[index] = sortValue
-   } else {
-   return fmt.Errorf("Illegal datatype %v", 
t.getDataTypes()[index])
+   var otherSlice = make([]int64, len(t.timestamps))
+   for i, schema := range t.measurementSchemas {
+   copy(otherSlice, t.timestamps)
+   sortedSlice := SortedSlices{
+   dataType: schema.DataType,
+   length: t.rowCount,
+   mainSlice:  t.values[i],
+   otherSlice: otherSlice,
}
+   sort.Sort(SortByOther(sortedSlice))
}
return nil

Review comment:
   The timestamps slice of the tablet should be sorted
   `sort.Slice(t.timestamps, func(i int, j int) bool {
return t.timestamps[i] < t.timestamps[j]
})
   `





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[jira] [Assigned] (IOTDB-1164) Optimize the executeBatch interface in JDBC

2021-02-22 Thread Houliang Qi (Jira)


 [ 
https://issues.apache.org/jira/browse/IOTDB-1164?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Houliang Qi reassigned IOTDB-1164:
--

Assignee: wangyanhong

> Optimize the executeBatch interface in JDBC
> ---
>
> Key: IOTDB-1164
> URL: https://issues.apache.org/jira/browse/IOTDB-1164
> Project: Apache IoTDB
>  Issue Type: Improvement
>  Components: JDBC
>Reporter: Houliang Qi
>Assignee: wangyanhong
>Priority: Major
>
> At present, the executeBatch method in JDBC is executed separately for each 
> statement.
> For the cluster version, each statement will be a raft log, which will lead 
> to the cost of the raft log scrambling for locks and the RPC cost between the 
> raft replication groups.
> The insertRecords and insertTablets interfaces in session API also have the 
> same problem,  for details please see the following links.
> The solution is similar to the previous one. The only difference is that the 
> statements in the executeBatch interface may not only insert data, but also 
> have metadata operations(like set storage group, create timeseries and so 
> on). It is necessary to distinguish between metadata operations and data 
> operations.
>  
> [1] https://issues.apache.org/jira/browse/IOTDB-1099
> [2] https://issues.apache.org/jira/browse/IOTDB-1163



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (IOTDB-1160) should they the same? "delete storage group root.sg" and "delete storage group root.sg.*"

2021-02-22 Thread Chao Wang (Jira)


[ 
https://issues.apache.org/jira/browse/IOTDB-1160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17288286#comment-17288286
 ] 

Chao Wang commented on IOTDB-1160:
--

I feel:
 * “*” match all ... 
 * if do not use "*",  do not delete . for example: "delete storage group 
root", will do not support...

> should they the same? "delete storage group root.sg" and "delete storage 
> group root.sg.*" 
> --
>
> Key: IOTDB-1160
> URL: https://issues.apache.org/jira/browse/IOTDB-1160
> Project: Apache IoTDB
>  Issue Type: Bug
>Affects Versions: 0.11.1
>Reporter: Xiangdong Huang
>Priority: Major
> Attachments: image-2021-02-19-01-43-40-882.png, 
> image-2021-02-19-16-14-24-767.png
>
>
> Now, they have the same effect:
> !image-2021-02-19-01-43-40-882.png|width=395,height=143!
>  
> - should they be the same?
> I think it is dangerous if we have two sgs, root.sg1 and root.sg2, and the 
> user mistakenly runs `delete storage group root` while he/she just wants to 
> delete one of them.
> - should "*" match multiple levels?
> It seems that in other statements, a "*" only match one level.
> maybe we can support "**" to match multiple levels.
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)