|
|
@ -29,10 +29,10 @@ const ( |
|
|
|
// 3. System columns (_ts_ns, _key) are added to user schema
|
|
|
|
// 4. Predicate pushdown is used for efficient scanning
|
|
|
|
type ParquetScanner struct { |
|
|
|
filerClient filer_pb.FilerClient |
|
|
|
chunkCache chunk_cache.ChunkCache |
|
|
|
topic topic.Topic |
|
|
|
recordSchema *schema_pb.RecordType |
|
|
|
filerClient filer_pb.FilerClient |
|
|
|
chunkCache chunk_cache.ChunkCache |
|
|
|
topic topic.Topic |
|
|
|
recordSchema *schema_pb.RecordType |
|
|
|
parquetLevels *schema.ParquetLevels |
|
|
|
} |
|
|
|
|
|
|
@ -47,7 +47,7 @@ func NewParquetScanner(filerClient filer_pb.FilerClient, namespace, topicName st |
|
|
|
// Create topic reference
|
|
|
|
t := topic.Topic{ |
|
|
|
Namespace: namespace, |
|
|
|
Name: topicName, |
|
|
|
Name: topicName, |
|
|
|
} |
|
|
|
|
|
|
|
// Read topic configuration to get schema
|
|
|
@ -257,27 +257,27 @@ func (ps *ParquetScanner) generateSampleData(options ScanOptions) []ScanResult { |
|
|
|
sampleData := []ScanResult{ |
|
|
|
{ |
|
|
|
Values: map[string]*schema_pb.Value{ |
|
|
|
"user_id": {Kind: &schema_pb.Value_Int32Value{Int32Value: 1001}}, |
|
|
|
"user_id": {Kind: &schema_pb.Value_Int32Value{Int32Value: 1001}}, |
|
|
|
"event_type": {Kind: &schema_pb.Value_StringValue{StringValue: "login"}}, |
|
|
|
"data": {Kind: &schema_pb.Value_StringValue{StringValue: `{"ip": "192.168.1.1"}`}}, |
|
|
|
"data": {Kind: &schema_pb.Value_StringValue{StringValue: `{"ip": "192.168.1.1"}`}}, |
|
|
|
}, |
|
|
|
Timestamp: now - 3600000000000, // 1 hour ago
|
|
|
|
Key: []byte("user-1001"), |
|
|
|
}, |
|
|
|
{ |
|
|
|
Values: map[string]*schema_pb.Value{ |
|
|
|
"user_id": {Kind: &schema_pb.Value_Int32Value{Int32Value: 1002}}, |
|
|
|
"user_id": {Kind: &schema_pb.Value_Int32Value{Int32Value: 1002}}, |
|
|
|
"event_type": {Kind: &schema_pb.Value_StringValue{StringValue: "page_view"}}, |
|
|
|
"data": {Kind: &schema_pb.Value_StringValue{StringValue: `{"page": "/dashboard"}`}}, |
|
|
|
"data": {Kind: &schema_pb.Value_StringValue{StringValue: `{"page": "/dashboard"}`}}, |
|
|
|
}, |
|
|
|
Timestamp: now - 1800000000000, // 30 minutes ago
|
|
|
|
Key: []byte("user-1002"), |
|
|
|
}, |
|
|
|
{ |
|
|
|
Values: map[string]*schema_pb.Value{ |
|
|
|
"user_id": {Kind: &schema_pb.Value_Int32Value{Int32Value: 1001}}, |
|
|
|
"user_id": {Kind: &schema_pb.Value_Int32Value{Int32Value: 1001}}, |
|
|
|
"event_type": {Kind: &schema_pb.Value_StringValue{StringValue: "logout"}}, |
|
|
|
"data": {Kind: &schema_pb.Value_StringValue{StringValue: `{"session_duration": 3600}`}}, |
|
|
|
"data": {Kind: &schema_pb.Value_StringValue{StringValue: `{"session_duration": 3600}`}}, |
|
|
|
}, |
|
|
|
Timestamp: now - 900000000000, // 15 minutes ago
|
|
|
|
Key: []byte("user-1001"), |
|
|
|