Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add pg xx #64

Merged
merged 116 commits into from
Jun 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
6989dd5
add PG
wensir-cloud Feb 20, 2023
e146300
fix bugs
wensir-cloud Feb 22, 2023
5dd1179
Merge branch 'IGinX-THU:main' into main
wensir-cloud Feb 24, 2023
b368ca8
fix pg bugs
wensir-cloud Feb 24, 2023
acd1a5f
fix bugs
wensir-cloud Feb 24, 2023
14453f7
fixx
wensir-cloud Feb 24, 2023
fb918d6
fix bug
wensir-cloud Feb 24, 2023
fb9482a
fix test
wensir-cloud Feb 24, 2023
8cb7100
fix bugs
wensir-cloud Feb 24, 2023
74a12a6
fix bug
wensir-cloud Feb 25, 2023
3f175db
Merge branch 'main' into main
wensir-cloud Feb 25, 2023
2f532fb
fix insert and select
wensir-cloud Feb 27, 2023
9bdf794
fix some error
wensir-cloud Feb 27, 2023
33d3291
fix code style and bugs
wensir-cloud Mar 1, 2023
564897d
fix code style
wensir-cloud Mar 1, 2023
63a8347
code style
wensir-cloud Mar 1, 2023
b7a0c62
code style
wensir-cloud Mar 1, 2023
6830194
code style
wensir-cloud Mar 1, 2023
bcda1c3
code style
wensir-cloud Mar 1, 2023
8a13997
Update config.properties
SolomonAnn Mar 1, 2023
7530a4a
Merge branch 'main' into main
wensir-cloud Mar 2, 2023
1ecd480
fix tags null and empty value
wensir-cloud Mar 2, 2023
1ed4784
Fix insert
SolomonAnn Mar 3, 2023
d2cf51a
fix
wensir-cloud Mar 8, 2023
6398c1a
fix
wensir-cloud Mar 8, 2023
091087c
fix
wensir-cloud Mar 8, 2023
1a706ae
Optimize insert
SolomonAnn Mar 9, 2023
4323047
Merge branch 'main' of github.com:wensir-cloud/IGinX-2 into main
SolomonAnn Mar 9, 2023
8d19a53
fix
wensir-cloud Mar 9, 2023
a321219
fix
wensir-cloud Mar 9, 2023
d8b469f
fix
wensir-cloud Mar 10, 2023
81d33ba
fix
wensir-cloud Mar 10, 2023
f8e17bf
Fix delete partially
SolomonAnn Mar 10, 2023
8c7c7b1
Fix delete partially
SolomonAnn Mar 10, 2023
7e9fe66
fix
wensir-cloud Mar 10, 2023
ad46768
Fix query partially
SolomonAnn Mar 10, 2023
6f8e722
fix
wensir-cloud Mar 12, 2023
da8b6ea
fix query
wensir-cloud Mar 12, 2023
46680e8
fix query
wensir-cloud Mar 12, 2023
2e62912
Fix conflicts
SolomonAnn Mar 13, 2023
ac15889
Update insert and get time series with tagkv
SolomonAnn Mar 13, 2023
067c720
Update all kinds of operations without expansion
SolomonAnn Mar 16, 2023
d13fdae
Merge remote-tracking branch 'upstream/main' into main
SolomonAnn Mar 16, 2023
d2c18a2
Remove unused files
SolomonAnn Mar 16, 2023
7c37215
Add actions
SolomonAnn Mar 16, 2023
d6b781d
Update linux startup shell
SolomonAnn Mar 16, 2023
b6a605a
Update macos startup shell
SolomonAnn Mar 16, 2023
851095b
Fix actions (#1)
SolomonAnn Mar 19, 2023
68139cc
Merge branch 'main' into main
SolomonAnn Mar 19, 2023
9d815a6
Update config
SolomonAnn Mar 19, 2023
b78f01d
Fix actions (#2)
SolomonAnn Mar 20, 2023
28f12fb
Fix conflicts
SolomonAnn Mar 21, 2023
ff92147
Support expansion (#3)
SolomonAnn Mar 21, 2023
35a43b4
Add expansion test (#4)
SolomonAnn Mar 21, 2023
d9c3ff1
Restore ByteUtils
SolomonAnn Mar 21, 2023
6f53b88
Fix actions
SolomonAnn Mar 21, 2023
a0dd5b7
Fix actions
SolomonAnn Mar 21, 2023
268855b
relationdb
wensir-cloud Apr 4, 2023
9b875fa
update
wensir-cloud Apr 17, 2023
5f86c22
update
wensir-cloud Apr 17, 2023
fcb29b0
t
wensir-cloud Apr 20, 2023
3220c0c
resolve conflicts
wensir-cloud Apr 20, 2023
c4016c0
fix
wensir-cloud Apr 21, 2023
d617c8a
fix format
wensir-cloud Apr 21, 2023
d9960ea
fix
wensir-cloud Apr 21, 2023
01cd13a
Merge branch 'main' into main
wensir-cloud Apr 24, 2023
25c1f66
Add passFormat
SolomonAnn May 8, 2023
5bba69e
Add passFormat
SolomonAnn May 8, 2023
86118a6
Merge remote-tracking branch 'upstream/main' into main
SolomonAnn May 9, 2023
c2846c6
Create a new branch
SolomonAnn May 9, 2023
6fa029b
Fix conflicts
SolomonAnn May 15, 2023
52178f9
Fix conflicts
SolomonAnn May 15, 2023
730730e
Fix conflicts
SolomonAnn May 17, 2023
ee56976
Fix conflicts
SolomonAnn May 17, 2023
e50ada8
Fix pg DB-CE
SolomonAnn May 17, 2023
aa941c6
Add order by time to query statement
SolomonAnn May 17, 2023
8c7a365
Modify port number
SolomonAnn May 17, 2023
254d1a6
Remove DBConf.txt
SolomonAnn May 17, 2023
e741740
Change conf
SolomonAnn May 17, 2023
4b6a0c9
Remove unused lines
SolomonAnn May 18, 2023
d679510
Specify database when generating history data
SolomonAnn May 18, 2023
f3fbed6
Switch databases properly
SolomonAnn May 18, 2023
388b0c4
Enable dummy tables with time column
SolomonAnn May 18, 2023
551b77a
Fix history data generator
SolomonAnn May 18, 2023
547165a
Fix history data generator
SolomonAnn May 18, 2023
9f0cd05
Fix history data generator
SolomonAnn May 19, 2023
10cf9d4
Add PostgreSQLFUNCTEST conf
SolomonAnn May 19, 2023
52cf4d8
Change timeout
SolomonAnn May 19, 2023
dc878c6
Change timeout
SolomonAnn May 19, 2023
9ff05b4
Change map-reduce to for-loop
SolomonAnn May 22, 2023
22b8084
Change timeout
SolomonAnn May 22, 2023
4be38cc
Change map-reduce to for-loop
SolomonAnn May 23, 2023
a02f636
Fix substring bug
SolomonAnn May 23, 2023
11e81c2
Fix expansion bug
SolomonAnn May 23, 2023
010bdb5
Fix conflicts
SolomonAnn May 24, 2023
823995e
Merge remote-tracking branch 'upstream/main' into main
SolomonAnn May 26, 2023
6dc0f1e
Fix conflicts
SolomonAnn Jun 7, 2023
c9ee0e8
Refactor storage interface
SolomonAnn Jun 8, 2023
48eda5b
Merge remote-tracking branch 'upstream/main' into main
SolomonAnn Jun 8, 2023
f6beaea
Refactor capacity expansion for pg
SolomonAnn Jun 8, 2023
da3940d
Fix conflicts
SolomonAnn Jun 8, 2023
1a9b3c4
Fix script bug
SolomonAnn Jun 8, 2023
2f0be33
Rename PostgreSQLHistoryDataGeneratorTest
SolomonAnn Jun 8, 2023
ca6cec2
Modify port number
SolomonAnn Jun 8, 2023
cbd45cc
Fix insert bug
SolomonAnn Jun 8, 2023
844b5f7
Change key name
SolomonAnn Jun 9, 2023
b32ace8
Merge remote-tracking branch 'upstream/main' into main
SolomonAnn Jun 9, 2023
d025b0d
Change key name
SolomonAnn Jun 9, 2023
e783783
Change key name
SolomonAnn Jun 9, 2023
9063d07
Change key name
SolomonAnn Jun 9, 2023
3e1313b
Modify port number
SolomonAnn Jun 9, 2023
603d961
Change timeseries to columns
SolomonAnn Jun 9, 2023
03b36b1
Fix clear data
SolomonAnn Jun 9, 2023
8984c91
Debug
SolomonAnn Jun 9, 2023
75e71c0
Debug
SolomonAnn Jun 9, 2023
6aad6a5
Remove logs
SolomonAnn Jun 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/actions/dbRunner/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,18 @@ runs:
echo "$RUNNER_OS is not supported"
exit 1
fi

- if: inputs.DB-name=='PostgreSQL'
name: Run DB
shell: bash
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
chmod +x "${GITHUB_WORKSPACE}/.github/postgresql.sh"
"${GITHUB_WORKSPACE}/.github/postgresql.sh"
elif [ "$RUNNER_OS" == "macOS" ]; then
chmod +x "${GITHUB_WORKSPACE}/.github/postgresql_macos.sh"
"${GITHUB_WORKSPACE}/.github/postgresql_macos.sh"
else
echo "$RUNNER_OS is not supported"
exit 1
fi
49 changes: 49 additions & 0 deletions .github/postgresql.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/bin/sh

set -e

sed -i "s/storageEngineList=127.0.0.1#6667#iotdb12/#storageEngineList=127.0.0.1#6667#iotdb12/g" conf/config.properties

sed -i "s/#storageEngineList=127.0.0.1#5432#postgresql/storageEngineList=127.0.0.1#5432#postgresql/g" conf/config.properties

sh -c "sudo sh -c 'echo \"deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main\" > /etc/apt/sources.list.d/pgdg.list'"

sh -c "wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -"

sh -c "sudo apt-get update"

sh -c "sudo apt-get -y install postgresql-15"

sh -c "sudo rm -rf /var/lib/postgresql/15/main"

sh -c "sudo mkdir -p /var/lib/postgresql/15/main"

sh -c "sudo chown -R postgres /var/lib/postgresql/15/main"

sh -c "sudo chmod -R 777 /var/lib/postgresql/15/main"

sh -c "sudo su - postgres -c '/usr/lib/postgresql/15/bin/initdb -D /var/lib/postgresql/15/main --auth trust --no-instructions'"

sh -c "sudo su - postgres -c '/usr/lib/postgresql/15/bin/pg_ctl -D /var/lib/postgresql/15/main start'"

sh -c "sudo su - postgres -c '/usr/lib/postgresql/15/bin/psql -c \"ALTER USER postgres WITH PASSWORD '\''postgres'\'';\"'"

sh -c "sudo mkdir -p /usr/lib/postgresql2"

sh -c "sudo chmod -R 777 /usr/lib/postgresql/15"

sh -c "sudo chmod -R 777 /usr/lib/postgresql2"

sh -c "sudo cp -R /usr/lib/postgresql/15 /usr/lib/postgresql2"

sh -c "sudo mkdir -p /var/lib/postgresql2/15/main"

sh -c "sudo chown -R postgres /var/lib/postgresql2/15/main"

sh -c "sudo chmod -R 777 /var/lib/postgresql2/15/main"

sh -c "sudo su - postgres -c '/usr/lib/postgresql2/15/bin/initdb -D /var/lib/postgresql2/15/main --auth trust --no-instructions'"

sh -c "sudo su - postgres -c '/usr/lib/postgresql2/15/bin/pg_ctl -D /var/lib/postgresql2/15/main -o \"-F -p 5433\" start'"

sh -c "sudo su - postgres -c '/usr/lib/postgresql2/15/bin/psql -c \"ALTER USER postgres WITH PASSWORD '\''postgres'\'';\"'"
53 changes: 53 additions & 0 deletions .github/postgresql_macos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/sh

set -e

sed -i "" "s/storageEngineList=127.0.0.1#6667#iotdb12/#storageEngineList=127.0.0.1#6667#iotdb12/g" conf/config.properties

sed -i "" "s/#storageEngineList=127.0.0.1#5432#postgresql/storageEngineList=127.0.0.1#5432#postgresql/g" conf/config.properties

sh -c "wget --quiet https://get.enterprisedb.com/postgresql/postgresql-15.2-1-osx-binaries.zip"

sh -c "sudo unzip -q postgresql-15.2-1-osx-binaries.zip"

sh -c "sudo dscl . -create /Users/postgres"

sh -c "sudo dscl . -create /Users/postgres UserShell /bin/bash"

sh -c "sudo dscl . -create /Users/postgres RealName \"PostgreSQL\""

sh -c "sudo dscl . -create /Users/postgres UniqueID 666"

sh -c "sudo dscl . -create /Users/postgres PrimaryGroupID 20"

sh -c "sudo dscl . -create /Users/postgres NFSHomeDirectory /Users/postgres"

sh -c "sudo dscl . -passwd /Users/postgres postgres"

sh -c "sudo dscl . -append /Groups/admin GroupMembership postgres"

sh -c "sudo mkdir -p /var/lib/postgresql/15/main"

sh -c "sudo chown -R postgres /var/lib/postgresql/15/main"

sh -c "sudo chmod -R 777 /var/lib/postgresql/15/main"

sh -c "cd pgsql/bin; sudo -u postgres ./initdb -D /var/lib/postgresql/15/main --auth trust --no-instructions"

sh -c "cd pgsql/bin; sudo -u postgres ./pg_ctl -D /var/lib/postgresql/15/main start"

sh -c "cd pgsql/bin; sudo -u postgres psql -c \"ALTER USER postgres WITH PASSWORD 'postgres';\""

sh -c "sudo cp -R pgsql pgsql2"

sh -c "sudo mkdir -p /var/lib/postgresql2/15/main"

sh -c "sudo chown -R postgres /var/lib/postgresql2/15/main"

sh -c "sudo chmod -R 777 /var/lib/postgresql2/15/main"

sh -c "cd pgsql2/bin; sudo -u postgres ./initdb -D /var/lib/postgresql2/15/main --auth trust --no-instructions"

sh -c "cd pgsql2/bin; sudo -u postgres ./pg_ctl -D /var/lib/postgresql2/15/main -o \"-F -p 5433\" start"

sh -c "cd pgsql2/bin; sudo -u postgres ./psql -c \"ALTER USER postgres WITH PASSWORD 'postgres';\""
2 changes: 1 addition & 1 deletion .github/workflows/DB-CE.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
java: [8]
python-version: ["3.7"]
os: [ubuntu-latest, macos-latest]
DB-name: ["IoTDB12", "InfluxDB", "Redis"]
DB-name: ["IoTDB12", "InfluxDB", "Redis", "PostgreSQL"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/standalone-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ jobs:
java: [8]
python-version: ["3.7"]
os: [ubuntu-latest, macos-latest]
DB-name: ["IoTDB12", "InfluxDB", "Parquet", "Redis"]
DB-name:
["IoTDB12", "InfluxDB", "Parquet", "PostgreSQL", "Redis"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
Expand All @@ -45,7 +46,7 @@ jobs:
- name: Change IGinX config
uses: ./.github/actions/confWriter
with:
DB-name: ${{matrix.DB-name}}
DB-name: ${{ matrix.DB-name }}
if-CapExp: false

- name: Start IGinX
Expand Down
2 changes: 1 addition & 1 deletion antlr/src/main/antlr4/cn/edu/tsinghua/iginx/sql/Sql.g4
Original file line number Diff line number Diff line change
Expand Up @@ -954,7 +954,7 @@ fragment NAME_CHAR
;

fragment CN_CHAR
: '\u2E85' .. '\u9FFF'
: '\u2E86' .. '\u9FFF'
;

DOUBLE_QUOTE_STRING_LITERAL
Expand Down
8 changes: 4 additions & 4 deletions conf/config.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ password=root
storageEngineList=127.0.0.1#6667#iotdb12#username=root#password=root#sessionPoolSize=20#has_data=false#is_read_only=false
#storageEngineList=127.0.0.1#8086#influxdb#url=http://localhost:8086/#token=your-token#organization=your-organization#has_data=false
#storageEngineList=127.0.0.1#4242#opentsdb#url=http://127.0.0.1
#storageEngineList=11.101.17.21#5432#timescaledb#username=postgres#password=123456
#storageEngineList=11.101.17.21#5432#postgresql#username=postgres#password=123456
#storageEngineList=127.0.0.1#5432#timescaledb#username=postgres#password=postgres
#storageEngineList=127.0.0.1#5432#postgresql#username=postgres#password=postgres#has_data=false
#storageEngineList=127.0.0.1#6667#parquet#dir=parquetData
#storageEngineList=127.0.0.1#27017#mongodb
#storageEngineList=127.0.0.1#6379#redis#has_data=false
Expand All @@ -27,8 +27,8 @@ storageEngineList=127.0.0.1#6667#iotdb12#username=root#password=root#sessionPool
replicaNum=0

# 底层数据库类名
databaseClassNames=iotdb12=cn.edu.tsinghua.iginx.iotdb.IoTDBStorage,influxdb=cn.edu.tsinghua.iginx.influxdb.InfluxDBStorage,parquet=cn.edu.tsinghua.iginx.parquet.ParquetStorage,mongodb=cn.edu.tsinghua.iginx.mongodb.MongoDBStorage,redis=cn.edu.tsinghua.iginx.redis.RedisStorage
#,opentsdb=cn.edu.tsinghua.iginx.opentsdb.OpenTSDBStorage,timescaledb=cn.edu.tsinghua.iginx.timescaledb.TimescaleDBStorage,postgresql=cn.edu.tsinghua.iginx.postgresql.PostgreSQLStorage
databaseClassNames=iotdb12=cn.edu.tsinghua.iginx.iotdb.IoTDBStorage,influxdb=cn.edu.tsinghua.iginx.influxdb.InfluxDBStorage,parquet=cn.edu.tsinghua.iginx.parquet.ParquetStorage,postgresql=cn.edu.tsinghua.iginx.postgresql.PostgreSQLStorage,mongodb=cn.edu.tsinghua.iginx.mongodb.MongoDBStorage,redis=cn.edu.tsinghua.iginx.redis.RedisStorage
#,opentsdb=cn.edu.tsinghua.iginx.opentsdb.OpenTSDBStorage,timescaledb=cn.edu.tsinghua.iginx.timescaledb.TimescaleDBStorage

# 内存任务执行线程池
memoryTaskThreadPoolSize=200
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ private void loadPropsFromFile() {
config.setDatabaseClassNames(
properties.getProperty(
"databaseClassNames",
"iotdb=cn.edu.tsinghua.iginx.iotdb.IoTDBPlanExecutor,influxdb=cn.edu.tsinghua.iginx.influxdb.InfluxDBPlanExecutor,parquet=cn.edu.tsinghua.iginx.parquet.parquetStorage,mongodb=cn.edu.tsinghua.iginx.mongodb.MongoDBStorage"));
"iotdb=cn.edu.tsinghua.iginx.iotdb.IoTDBPlanExecutor,influxdb=cn.edu.tsinghua.iginx.influxdb.InfluxDBPlanExecutor,parquet=cn.edu.tsinghua.iginx.parquet.parquetStorage,mongodb=cn.edu.tsinghua.iginx.mongodb.MongoDBStorage,postgresql=cn.edu.tsinghua.iginx.postgresql.PostgreSQLStorage"));
// ,opentsdb=cn.edu.tsinghua.iginx.opentsdb.OpenTSDBStorage,timescaledb=cn.edu.tsinghua.iginx.timescaledb.TimescaleDBStorage,postgresql=cn.edu.tsinghua.iginx.postgresql.PostgreSQLStorage

config.setPolicyClassName(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public int getPathNum() {
return endPathIndex - startPathIndex;
}

public int getTimeSize() {
public int getKeySize() {
return endKeyIndex - startKeyIndex;
}

Expand All @@ -92,11 +92,19 @@ public int getPathIndex(String path) {
return data.getPaths().contains(path) ? data.getPaths().indexOf(path) - startPathIndex : -1;
}

public List<String> getPaths() {
return data.getPaths().subList(startPathIndex, endPathIndex);
}

public String getPath(int index) {
checkPathIndexRange(index);
return data.getPaths().get(startPathIndex + index);
}

public List<DataType> getDataTypeList() {
return data.getDataTypeList().subList(startPathIndex, endPathIndex);
}

public DataType getDataType(int index) {
checkTypeIndexRange(index);
return data.getDataTypeList().get(startPathIndex + index);
Expand All @@ -117,6 +125,13 @@ public Long getKey(int index) {

public abstract BitmapView getBitmapView(int index);

public List<Map<String, String>> getTagsList() {
if (data.getTagsList() != null && !data.getTagsList().isEmpty()) {
return data.getTagsList().subList(startPathIndex, endPathIndex);
}
return data.getTagsList();
}

public Map<String, String> getTags(int index) {
checkPathIndexRange(index);
List<Map<String, String>> tagsList = data.getTagsList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ public void saveTimeSeriesData(InsertStatement statement) {
long totalByte = 0L;
int count = 0;
BitmapView bitmapView = view.getBitmapView(i);
for (int j = 0; j < view.getTimeSize(); j++) {
for (int j = 0; j < view.getKeySize(); j++) {
if (bitmapView.get(j)) {
minn = Math.min(minn, view.getKey(j));
maxx = Math.max(maxx, view.getKey(j));
Expand All @@ -822,7 +822,7 @@ public void saveTimeSeriesData(InsertStatement statement) {
Arrays.fill(minn, Long.MAX_VALUE);
Arrays.fill(maxx, Long.MIN_VALUE);

for (int i = 0; i < view.getTimeSize(); i++) {
for (int i = 0; i < view.getKeySize(); i++) {
BitmapView bitmapView = view.getBitmapView(i);
int index = 0;
for (int j = 0; j < view.getPathNum(); j++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public void record(FragmentMeta fragmentMeta, Operator operator) {
if (operator.getType() == OperatorType.Insert) {
Insert insert = (Insert) operator;
long count = writeRequestsMap.getOrDefault(fragmentMeta, 0L);
count += (long) insert.getData().getPathNum() * insert.getData().getTimeSize();
count += (long) insert.getData().getPathNum() * insert.getData().getKeySize();
writeRequestsMap.put(fragmentMeta, count);
} else if (operator.getType() == OperatorType.Project) {
long count = readRequestsMap.getOrDefault(fragmentMeta, 0L);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ private Exception insertRowRecords(RowDataView data, String storageUnit) {
}

List<Point> points = new ArrayList<>();
for (int i = 0; i < data.getTimeSize(); i++) {
for (int i = 0; i < data.getKeySize(); i++) {
BitmapView bitmapView = data.getBitmapView(i);
int index = 0;
for (int j = 0; j < data.getPathNum(); j++) {
Expand Down Expand Up @@ -619,7 +619,7 @@ private Exception insertColumnRecords(ColumnDataView data, String storageUnit) {
InfluxDBSchema schema = new InfluxDBSchema(data.getPath(i), data.getTags(i));
BitmapView bitmapView = data.getBitmapView(i);
int index = 0;
for (int j = 0; j < data.getTimeSize(); j++) {
for (int j = 0; j < data.getKeySize(); j++) {
if (bitmapView.get(j)) {
switch (data.getDataType(i)) {
case BOOLEAN:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public int getPathNum() {
}

public int getTimeSize() {
return dataView.getTimeSize();
return dataView.getKeySize();
}

public String getPath(int index) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ private Exception insertRowRecords(RowDataView data, String storageUnit) {
}

Map<MongoDBSchema, List<JSONObject>> points = new HashMap<>();
for (int i = 0; i < data.getTimeSize(); i++) {
for (int i = 0; i < data.getKeySize(); i++) {
BitmapView bitmapView = data.getBitmapView(i);
int index = 0;
for (int j = 0; j < data.getPathNum(); j++) {
Expand Down Expand Up @@ -427,7 +427,7 @@ private Exception insertColumnRecords(ColumnDataView data, String storageUnit) {
BitmapView bitmapView = data.getBitmapView(i);
int index = 0;
List<JSONObject> jsonObjects = new ArrayList<>();
for (int j = 0; j < data.getTimeSize(); j++) {
for (int j = 0; j < data.getKeySize(); j++) {
if (bitmapView.get(j)) {
Map<String, Object> timeAndValueMap = new HashMap<>();
timeAndValueMap.put(MongoDBStorage.INNER_TIMESTAMP, data.getKey(j));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public int getPathNum() {
}

public int getTimeSize() {
return dataView.getTimeSize();
return dataView.getKeySize();
}

public String getPath(int index) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ public TaskExecuteResult executeInsertTask(DataView dataView, String storageUnit
tagsList.add(dataView.getTags(i) == null ? new HashMap<>() : dataView.getTags(i));
}

long[] times = new long[dataView.getTimeSize()];
for (int i = 0; i < dataView.getTimeSize(); i++) {
long[] times = new long[dataView.getKeySize()];
for (int i = 0; i < dataView.getKeySize(); i++) {
times[i] = dataView.getKey(i);
}

Expand Down Expand Up @@ -200,7 +200,7 @@ private Pair<List<ByteBuffer>, List<ByteBuffer>> compressRowData(DataView dataVi
dataTypeList.add(dataView.getDataType(i));
}

for (int i = 0; i < dataView.getTimeSize(); i++) {
for (int i = 0; i < dataView.getKeySize(); i++) {
BitmapView bitmapView = dataView.getBitmapView(i);
Object[] values = new Object[dataView.getPathNum()];

Expand All @@ -226,10 +226,10 @@ private Pair<List<ByteBuffer>, List<ByteBuffer>> compressColData(DataView dataVi
for (int i = 0; i < dataView.getPathNum(); i++) {
DataType dataType = dataView.getDataType(i);
BitmapView bitmapView = dataView.getBitmapView(i);
Object[] values = new Object[dataView.getTimeSize()];
Object[] values = new Object[dataView.getKeySize()];

int index = 0;
for (int j = 0; j < dataView.getTimeSize(); j++) {
for (int j = 0; j < dataView.getKeySize(); j++) {
if (bitmapView.get(j)) {
values[j] = dataView.getValue(i, index);
index++;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public int getPathNum() {
}

public int getTimeSize() {
return dataView.getTimeSize();
return dataView.getKeySize();
}

public String getPath(int index) {
Expand Down
2 changes: 1 addition & 1 deletion dataSources/postgresql/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.4.3</version>
<version>42.5.4</version>
</dependency>
</dependencies>

Expand Down
Loading