Skip to content

Commit

Permalink
Pipe: Support table pattern matching when sync data between clusters (#…
Browse files Browse the repository at this point in the history
…13817 following fixup) (#13830)
  • Loading branch information
SteveYurongSu authored Oct 18, 2024
1 parent 4bd629e commit 0d8ad0c
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,11 @@ private void parseAndCollectEvent(final PipeTsFileInsertionEvent sourceEvent) th
return;
}

if (!forceTabletFormat && !sourceEvent.shouldParseTimeOrPattern()) {
if (!forceTabletFormat
&& (!sourceEvent.shouldParseTimeOrPattern()
|| (sourceEvent.isTableModelEvent()
&& sourceEvent.getTablePattern() == null
&& !sourceEvent.shouldParseTime()))) {
collectEvent(sourceEvent);
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ public synchronized void onSuccess() {
insertNodeBuffers.clear();
tabletBuffers.clear();

binaryDataBases.clear();
inertNodeDataBases.clear();
tabletDataBases.clear();

pipe2BytesAccumulated.clear();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ private Tablet buildNextTablet() throws IOException {
new Tablet(tableName, columnSchemas, columnTypes, tsBlock.getPositionCount());
tablet.initBitMaps();

boolean isAllNull = true;

final TsBlock.TsBlockRowIterator rowIterator = tsBlock.getTsBlockRowIterator();
while (rowIterator.hasNext()) {
final Object[] row = rowIterator.next();
Expand All @@ -114,11 +116,19 @@ private Tablet buildNextTablet() throws IOException {
final int rowIndex = tablet.rowSize;
tablet.addTimestamp(rowIndex, timestamp);
for (int i = 0, fieldSize = row.length - 1; i < fieldSize; i++) {
tablet.addValue(columnNames.get(i), rowIndex, row[i]);
final Object value = row[i];
tablet.addValue(columnNames.get(i), rowIndex, value);
if (value != null && columnTypes.get(i) == Tablet.ColumnType.MEASUREMENT) {
isAllNull = false;
}
}
tablet.rowSize++;
}

if (isAllNull) {
tablet.rowSize = 0;
}

return tablet;
}
}
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
<thrift.version>0.14.1</thrift.version>
<xz.version>1.9</xz.version>
<zstd-jni.version>1.5.6-3</zstd-jni.version>
<tsfile.version>1.2.0-241018-SNAPSHOT</tsfile.version>
<tsfile.version>1.2.0-4e902e0-SNAPSHOT</tsfile.version>
</properties>
<!--
if we claim dependencies in dependencyManagement, then we do not claim
Expand Down

0 comments on commit 0d8ad0c

Please sign in to comment.