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

Fix #116: remove base values from C* tables #140

Merged
merged 1 commit into from
Jan 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 0 additions & 6 deletions writer/cassandra/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ var tables []string = []string{
id timeuuid,
publisher text,
protocol text,
bn text,
bt double,
bu text,
bv double,
bs double,
bver int,
n text,
u text,
v double,
Expand Down
7 changes: 3 additions & 4 deletions writer/cassandra/messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ func normalize(msg writer.RawMessage) ([]writer.Message, error) {
Channel: msg.Channel,
Publisher: msg.Publisher,
Protocol: msg.Protocol,
Version: v.BaseVersion,
Name: v.Name,
Unit: v.Unit,
StringValue: v.StringValue,
Expand Down Expand Up @@ -75,11 +74,11 @@ func (repo *msgRepository) Save(raw writer.RawMessage) error {

for _, msg := range msgs {
cql := `INSERT INTO messages_by_channel
(channel, id, publisher, protocol, bver, n, u, v, vs, vb, vd, s, t, ut, l)
VALUES (?, now(), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`
(channel, id, publisher, protocol, n, u, v, vs, vb, vd, s, t, ut, l)
VALUES (?, now(), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`

err = repo.session.Query(cql, msg.Channel, msg.Publisher, msg.Protocol,
msg.Version, msg.Name, msg.Unit, msg.Value, msg.StringValue, msg.BoolValue,
msg.Name, msg.Unit, msg.Value, msg.StringValue, msg.BoolValue,
msg.DataValue, msg.ValueSum, msg.Time, msg.UpdateTime, msg.Link).Exec()

if err != nil {
Expand Down
1 change: 0 additions & 1 deletion writer/messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ type Message struct {
Channel string
Publisher string
Protocol string
Version int `json:"bver,omitempty"`
Name string `json:"n,omitempty"`
Unit string `json:"u,omitempty"`
Value float64 `json:"v,omitempty"`
Expand Down