File tree Expand file tree Collapse file tree 4 files changed +16
-3
lines changed
client/src/pages/SearchPage/SearchResults/SearchResultsTable/Presto/PrestoResultsVirtualTable
server/src/routes/api/presto-search Expand file tree Collapse file tree 4 files changed +16
-3
lines changed Original file line number Diff line number Diff line change 1+ import type { PrestoRowObject } from "../../../../../../../../common/index.js" ;
2+
3+
14/**
25 * Structure of dynamic Presto search results data.
36 */
4- interface PrestoSearchResult {
7+ interface PrestoSearchResult extends PrestoRowObject {
58 _id : string ;
6- row : Record < string , unknown > ;
79}
810
911export type { PrestoSearchResult } ;
Original file line number Diff line number Diff line change 11import { TableProps } from "antd" ;
2+
23import { PrestoSearchResult } from "./typings" ;
34
45
Original file line number Diff line number Diff line change @@ -129,12 +129,21 @@ interface SearchResultsMetadataDocument {
129129 numTotalResults ?: number ;
130130 queryEngine : CLP_QUERY_ENGINES ;
131131}
132+
133+ /**
134+ * Presto row wrapped in a `row` property to prevent conflicts with MongoDB's `_id` field.
135+ */
136+ interface PrestoRowObject {
137+ row : Record < string , unknown > ;
138+ }
139+
132140export {
133141 CLP_QUERY_ENGINES ,
134142 SEARCH_SIGNAL ,
135143} ;
136144export type {
137145 PRESTO_SEARCH_SIGNAL ,
146+ PrestoRowObject ,
138147 SearchResultsMetadataDocument ,
139148 ClientToServerEvents ,
140149 Err ,
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import type {
33 InsertManyResult ,
44} from "mongodb" ;
55
6+ import type { PrestoRowObject } from "../../../../../common/index.js" ;
67
78/**
89 * Converts a Presto result row (array of values) into an object, using the provided column
@@ -15,7 +16,7 @@ import type {
1516const prestoRowToObject = (
1617 row : unknown [ ] ,
1718 columns : { name : string } [ ]
18- ) : Record < string , unknown > => {
19+ ) : PrestoRowObject => {
1920 const obj : Record < string , unknown > = { } ;
2021 columns . forEach ( ( col , idx ) => {
2122 obj [ col . name ] = row [ idx ] ;
You can’t perform that action at this time.
0 commit comments