The side effect of `example/session_example.go`

Open
#141 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
go
Domain
databases

Research direction

Start by reading and running example/session_example.go, then use the IoTDB CLI to reproduce the databases shown by show databases. Determine how its test data is inserted and deleted; done means the example leaves no test databases or devices behind while preserving pre-existing business data with matching names.

Written by the indexing model from the issue text.

Description

After running example/session_example.go, you will notice the following databases appear in the IoTdb instance.

root@iotdb-service:/iotdb/sbin# show databases
bash: show: command not found
root@iotdb-service:/iotdb/sbin# ./start-cli.sh
---------------------
Starting IoTDB Cli
---------------------
 _____       _________  ______   ______    
|_   _|     |  _   _  ||_   _ `.|_   _ \   
  | |   .--.|_/ | | \_|  | | `. \ | |_) |  
  | | / .'`\ \  | |      | |  | | |  __'.  
 _| |_| \__. | _| |_    _| |_.' /_| |__) | 
|_____|'.__.' |_____|  |______.'|_______/  version 2.0.5 (Build: 0917050)
                                           

Successfully login at 127.0.0.1:6667
IoTDB> show databases
+--------+-----------------------+---------------------+-------------------+---------------------+
|Database|SchemaReplicationFactor|DataReplicationFactor|TimePartitionOrigin|TimePartitionInterval|
+--------+-----------------------+---------------------+-------------------+---------------------+
|root.al1|                      1|                    1|                  0|            604800000|
| root.ln|                      1|                    1|                  0|            604800000|
|root.sg1|                      1|                    1|                  0|            604800000|
+--------+-----------------------+---------------------+-------------------+---------------------+
Total line number = 3
It costs 0.025s

By default, there are no databases in an IoTdb instance. The databases mentioned in the previous output must have been created as a side effect of example/session_example.go.

In my personal opinion, for database testing, all test data should be completely deleted after the test ends.

This test clearly does not meet this requirement.

To avoid deleting existing business data, when inserting and deleting data, detection should also be added to avoid deleting existing devices with the same name or databases with the same name in the iotdb instance.

Dominant language
Go
Stars
74
Forks
45
Avg merge
11d 13h
Merged PRs (30d)
1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/iotdb-client-go

All issues in apache/iotdb-client-go

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.