[
https://issues.apache.org/jira/browse/DRILL-7476?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16993402#comment-16993402
]
ASF GitHub Bot commented on DRILL-7476:
---------------------------------------
vvysotskyi commented on pull request #1922: DRILL-7476: Set lastSet on
TransferPair copies
URL: https://github.com/apache/drill/pull/1922#discussion_r356482355
##########
File path:
exec/java-exec/src/main/java/org/apache/drill/exec/record/FragmentWritableBatch.java
##########
@@ -23,65 +23,87 @@
import org.apache.drill.exec.proto.UserBitShared.QueryId;
import org.apache.drill.exec.proto.UserBitShared.RecordBatchDef;
-public class FragmentWritableBatch{
- static final org.slf4j.Logger logger =
org.slf4j.LoggerFactory.getLogger(FragmentWritableBatch.class);
+public class FragmentWritableBatch {
private static RecordBatchDef EMPTY_DEF =
RecordBatchDef.newBuilder().setRecordCount(0).build();
private final ByteBuf[] buffers;
private final FragmentRecordBatch header;
- public FragmentWritableBatch(final boolean isLast, final QueryId queryId,
final int sendMajorFragmentId, final int sendMinorFragmentId, final int
receiveMajorFragmentId, final int receiveMinorFragmentId, final WritableBatch
batch){
- this(isLast, queryId, sendMajorFragmentId, sendMinorFragmentId,
receiveMajorFragmentId, new int[]{receiveMinorFragmentId}, batch.getDef(),
batch.getBuffers());
+ public FragmentWritableBatch(boolean isLast, QueryId queryId,
+ int sendMajorFragmentId, int sendMinorFragmentId,
+ int receiveMajorFragmentId, int receiveMinorFragmentId,
+ WritableBatch batch){
+ this(isLast, queryId, sendMajorFragmentId, sendMinorFragmentId,
receiveMajorFragmentId,
+ new int[]{receiveMinorFragmentId}, batch.getDef(), batch.getBuffers());
}
- public FragmentWritableBatch(final boolean isLast, final QueryId queryId,
final int sendMajorFragmentId, final int sendMinorFragmentId, final int
receiveMajorFragmentId, final int[] receiveMinorFragmentIds, final
WritableBatch batch){
- this(isLast, queryId, sendMajorFragmentId, sendMinorFragmentId,
receiveMajorFragmentId, receiveMinorFragmentIds, batch.getDef(),
batch.getBuffers());
+ public FragmentWritableBatch(boolean isLast, QueryId queryId,
+ int sendMajorFragmentId, int sendMinorFragmentId,
+ int receiveMajorFragmentId, int[] receiveMinorFragmentIds,
+ WritableBatch batch){
+ this(isLast, queryId, sendMajorFragmentId, sendMinorFragmentId,
+ receiveMajorFragmentId, receiveMinorFragmentIds, batch.getDef(),
+ batch.getBuffers());
}
- private FragmentWritableBatch(final boolean isLast, final QueryId queryId,
final int sendMajorFragmentId, final int sendMinorFragmentId, final int
receiveMajorFragmentId, final int[] receiveMinorFragmentId, final
RecordBatchDef def, final ByteBuf... buffers){
+ private FragmentWritableBatch(boolean isLast, QueryId queryId,
+ int sendMajorFragmentId, int sendMinorFragmentId,
+ int receiveMajorFragmentId, int[] receiveMinorFragmentId,
+ RecordBatchDef def, ByteBuf... buffers){
this.buffers = buffers;
- final FragmentRecordBatch.Builder builder =
FragmentRecordBatch.newBuilder()
+ FragmentRecordBatch.Builder builder = FragmentRecordBatch.newBuilder()
.setIsLastBatch(isLast)
.setDef(def)
.setQueryId(queryId)
.setReceivingMajorFragmentId(receiveMajorFragmentId)
.setSendingMajorFragmentId(sendMajorFragmentId)
.setSendingMinorFragmentId(sendMinorFragmentId);
- for(final int i : receiveMinorFragmentId){
+ for(int i : receiveMinorFragmentId){
builder.addReceivingMinorFragmentId(i);
}
this.header = builder.build();
}
-
- public static FragmentWritableBatch getEmptyLast(final QueryId queryId,
final int sendMajorFragmentId, final int sendMinorFragmentId, final int
receiveMajorFragmentId, final int receiveMinorFragmentId){
- return getEmptyLast(queryId, sendMajorFragmentId, sendMinorFragmentId,
receiveMajorFragmentId, new int[]{receiveMinorFragmentId});
+ public static FragmentWritableBatch getEmptyLast(QueryId queryId,
+ int sendMajorFragmentId, int sendMinorFragmentId,
+ int receiveMajorFragmentId, int receiveMinorFragmentId){
+ return getEmptyLast(queryId, sendMajorFragmentId, sendMinorFragmentId,
+ receiveMajorFragmentId, new int[]{receiveMinorFragmentId});
}
- public static FragmentWritableBatch getEmptyLast(final QueryId queryId,
final int sendMajorFragmentId, final int sendMinorFragmentId, final int
receiveMajorFragmentId, final int[] receiveMinorFragmentIds){
- return new FragmentWritableBatch(true, queryId, sendMajorFragmentId,
sendMinorFragmentId, receiveMajorFragmentId, receiveMinorFragmentIds,
EMPTY_DEF);
+ public static FragmentWritableBatch getEmptyLast(QueryId queryId,
+ int sendMajorFragmentId, int sendMinorFragmentId,
+ int receiveMajorFragmentId, int[] receiveMinorFragmentIds){
+ return new FragmentWritableBatch(true, queryId, sendMajorFragmentId,
+ sendMinorFragmentId, receiveMajorFragmentId, receiveMinorFragmentIds,
+ EMPTY_DEF);
}
-
- public static FragmentWritableBatch getEmptyLastWithSchema(final QueryId
queryId, final int sendMajorFragmentId, final int sendMinorFragmentId,
- final int
receiveMajorFragmentId, final int receiveMinorFragmentId, final BatchSchema
schema){
- return getEmptyBatchWithSchema(true, queryId, sendMajorFragmentId,
sendMinorFragmentId, receiveMajorFragmentId,
+ public static FragmentWritableBatch getEmptyLastWithSchema(
+ QueryId queryId, int sendMajorFragmentId,
+ int sendMinorFragmentId, int receiveMajorFragmentId,
+ int receiveMinorFragmentId, BatchSchema schema){
+ return getEmptyBatchWithSchema(true, queryId, sendMajorFragmentId,
+ sendMinorFragmentId, receiveMajorFragmentId,
receiveMinorFragmentId, schema);
}
- public static FragmentWritableBatch getEmptyBatchWithSchema(final boolean
isLast, final QueryId queryId, final int sendMajorFragmentId,
- final int sendMinorFragmentId, final int receiveMajorFragmentId, final
int receiveMinorFragmentId, final BatchSchema schema){
+ public static FragmentWritableBatch getEmptyBatchWithSchema(
+ boolean isLast, QueryId queryId, int sendMajorFragmentId,
+ int sendMinorFragmentId, int receiveMajorFragmentId,
+ int receiveMinorFragmentId, BatchSchema schema){
Review comment:
```suggestion
int receiveMinorFragmentId, BatchSchema schema) {
```
----------------------------------------------------------------
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:
[email protected]
> Info in some sys schema tables are missing if queried with limit clause
> -----------------------------------------------------------------------
>
> Key: DRILL-7476
> URL: https://issues.apache.org/jira/browse/DRILL-7476
> Project: Apache Drill
> Issue Type: Bug
> Affects Versions: 1.17.0
> Reporter: Arina Ielchiieva
> Assignee: Paul Rogers
> Priority: Blocker
> Fix For: 1.17.0
>
>
> Affected schema: sys
> Affected tables: connections, threads, memory
> If query is executed with limit clause, information for some fields is
> missing:
> *Connections*
> {noformat}
> apache drill (sys)> select * from connections;
> +-----------+---------------+------------+-------------------------+-------------------+---------+-----------------+-------------+----------+--------------------------------------+
> | user | client | drillbit | established |
> duration | queries | isAuthenticated | isEncrypted | usingSSL |
> session |
> +-----------+---------------+------------+-------------------------+-------------------+---------+-----------------+-------------+----------+--------------------------------------+
> | anonymous | xxx.xxx.x.xxx | xxx | 2019-12-10 13:45:01.766 | 59 min 42.393
> sec | 27 | false | false | false | xxx |
> +-----------+---------------+------------+-------------------------+-------------------+---------+-----------------+-------------+----------+--------------------------------------+
> 1 row selected (0.1 seconds)
> apache drill (sys)> select * from connections limit 1;
> +------+--------+----------+-------------------------+----------+---------+-----------------+-------------+----------+---------+
> | user | client | drillbit | established | duration | queries |
> isAuthenticated | isEncrypted | usingSSL | session |
> +------+--------+----------+-------------------------+----------+---------+-----------------+-------------+----------+---------+
> | | | | 2019-12-10 13:45:01.766 | | 28 |
> false | false | false | |
> +------+--------+----------+-------------------------+----------+---------+-----------------+-------------+----------+---------+
> {noformat}
> *Threads*
> {noformat}
> apache drill (sys)> select * from threads;
> +------------+-----------+---------------+--------------+
> | hostname | user_port | total_threads | busy_threads |
> +------------+-----------+---------------+--------------+
> | xxx | 31010 | 27 | 23 |
> +------------+-----------+---------------+--------------+
> 1 row selected (0.119 seconds)
> apache drill (sys)> select * from threads limit 1;
> +----------+-----------+---------------+--------------+
> | hostname | user_port | total_threads | busy_threads |
> +----------+-----------+---------------+--------------+
> | | 31010 | 27 | 24 |
> {noformat}
> *Memory*
> {noformat}
> apache drill (sys)> select * from memory;
> +------------+-----------+--------------+------------+----------------+--------------------+------------+
> | hostname | user_port | heap_current | heap_max | direct_current |
> jvm_direct_current | direct_max |
> +------------+-----------+--------------+------------+----------------+--------------------+------------+
> | xxx | 31010 | 493974480 | 4116185088 | 5048576 | 122765
> | 8589934592 |
> +------------+-----------+--------------+------------+----------------+--------------------+------------+
> 1 row selected (0.115 seconds)
> apache drill (sys)> select * from memory limit 1;
> +----------+-----------+--------------+------------+----------------+--------------------+------------+
> | hostname | user_port | heap_current | heap_max | direct_current |
> jvm_direct_current | direct_max |
> +----------+-----------+--------------+------------+----------------+--------------------+------------+
> | | 31010 | 499343272 | 4116185088 | 9048576 | 122765
> | 8589934592 |
> +----------+-----------+--------------+------------+----------------+--------------------+------------+
> {noformat}
> When selecting data from *Drillbits* table which has similar fields (ex:
> hostname), everything is fine:
> {noformat}
> apache drill (sys)> select * from drillbits;
> +------------+-----------+--------------+-----------+-----------+---------+---------+--------+
> | hostname | user_port | control_port | data_port | http_port | current |
> version | state |
> +------------+-----------+--------------+-----------+-----------+---------+---------+--------+
> | xxx | 31010 | 31011 | 31012 | 8047 | true | 1.17.0
> | ONLINE |
> +------------+-----------+--------------+-----------+-----------+---------+---------+--------+
> 1 row selected (0.114 seconds)
> apache drill (sys)> select * from drillbits limit 1;
> +------------+-----------+--------------+-----------+-----------+---------+---------+--------+
> | hostname | user_port | control_port | data_port | http_port | current |
> version | state |
> +------------+-----------+--------------+-----------+-----------+---------+---------+--------+
> | xxx | 31010 | 31011 | 31012 | 8047 | true | 1.17.0
> | ONLINE |
> +------------+-----------+--------------+-----------+-----------+---------+---------+--------+
> {noformat}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)