Skip to content

Commit

Permalink
fix: Logging
Browse files Browse the repository at this point in the history
  • Loading branch information
vbhagwat committed Jan 31, 2025
1 parent 07471d0 commit 6e72718
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions go/internal/feast/onlinestore/cassandraonlinestore.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,6 @@ func (c *CassandraOnlineStore) getMultiKeyCQLStatement(tableName string, feature
for i := 0; i < nkeys; i++ {
keyPlaceholders[i] = "?"
}
fmt.Printf("Number of keys: %d\n", nkeys)
fmt.Printf("Number of placeholders: %d\n", len(keyPlaceholders))
return fmt.Sprintf(
`SELECT "entity_key", "feature_name", "event_ts", "value" FROM %s WHERE "entity_key" IN (%s) AND "feature_name" IN (%s)`,
tableName,
Expand Down Expand Up @@ -425,7 +423,7 @@ func (c *CassandraOnlineStore) BatchedKeysOnlineRead(ctx context.Context, entity
if len(uniqueNames) != 1 {
return nil, fmt.Errorf("rejecting OnlineRead as more than 1 feature view was tried to be read at once")
}
fmt.Printf("Input entityKeys:%d", len(entityKeys))
log.Info().Msgf("BatchedKeysOnlineRead: Number of entity keys %d", entityKeys)

Check failure on line 426 in go/internal/feast/onlinestore/cassandraonlinestore.go

View workflow job for this annotation

GitHub Actions / unit-test-go (3.9, ubuntu-latest)

(*github.com/rs/zerolog.Event).Msgf format %d has arg entityKeys of wrong type []*github.com/feast-dev/feast/go/protos/feast/types.EntityKey

Check failure on line 426 in go/internal/feast/onlinestore/cassandraonlinestore.go

View workflow job for this annotation

GitHub Actions / unit-test-go (3.10, ubuntu-latest)

(*github.com/rs/zerolog.Event).Msgf format %d has arg entityKeys of wrong type []*github.com/feast-dev/feast/go/protos/feast/types.EntityKey

Check failure on line 426 in go/internal/feast/onlinestore/cassandraonlinestore.go

View workflow job for this annotation

GitHub Actions / unit-test-go (3.11, ubuntu-latest)

(*github.com/rs/zerolog.Event).Msgf format %d has arg entityKeys of wrong type []*github.com/feast-dev/feast/go/protos/feast/types.EntityKey
serializedEntityKeys, serializedEntityKeyToIndex, err := c.buildCassandraEntityKeys(entityKeys)

if err != nil {
Expand All @@ -450,7 +448,7 @@ func (c *CassandraOnlineStore) BatchedKeysOnlineRead(ctx context.Context, entity
nKeys := len(serializedEntityKeys)
batchSize := c.keyBatchSize
nBatches := int(math.Ceil(float64(nKeys) / float64(batchSize)))
fmt.Printf("Total number of serializedEntityKeys: %d, Batch size: %d, Total batches: %d\n", nKeys, batchSize, nBatches)
log.Info().Msgf("BatchedKeysOnlineRead: Total number of serializedEntityKeys: %d, Batch size: %d, Total batches: %d\n", nKeys, batchSize, nBatches)
batches := make([][]any, nBatches)
nAssigned := 0
for i := 0; i < nBatches; i++ {
Expand All @@ -476,12 +474,8 @@ func (c *CassandraOnlineStore) BatchedKeysOnlineRead(ctx context.Context, entity
cqlStatement = c.getMultiKeyCQLStatement(tableName, featureNames, currentBatchLength)
prevBatchLength = currentBatchLength
}
go func(keyBatch []any, statement string) {
go func(keyBatch []any, cqlStatement string) {
defer waitGroup.Done()
// this caches the previous batch query if it had the same number of keys
if len(keyBatch) != prevBatchLength {
cqlStatement = c.getMultiKeyCQLStatement(tableName, featureNames, len(keyBatch))
}
iter := c.session.Query(cqlStatement, keyBatch...).WithContext(ctx).Iter()

scanner := iter.Scanner()
Expand Down

0 comments on commit 6e72718

Please sign in to comment.