29
29
import org .apache .doris .statistics .Statistics ;
30
30
31
31
import java .util .List ;
32
+ import java .util .Objects ;
32
33
import java .util .Optional ;
33
34
34
35
/**
35
36
* PhysicalSchemaScan.
36
37
*/
37
38
public class PhysicalSchemaScan extends PhysicalCatalogRelation {
38
39
40
+ private final Optional <String > schemaCatalog ;
41
+ private final Optional <String > schemaDatabase ;
42
+ private final Optional <String > schemaTable ;
43
+
39
44
public PhysicalSchemaScan (RelationId id , TableIf table , List <String > qualifier ,
40
- Optional <GroupExpression > groupExpression , LogicalProperties logicalProperties ) {
45
+ Optional <GroupExpression > groupExpression , LogicalProperties logicalProperties ,
46
+ Optional <String > schemaCatalog , Optional <String > schemaDatabase , Optional <String > schemaTable ) {
41
47
super (id , PlanType .PHYSICAL_SCHEMA_SCAN , table , qualifier , groupExpression , logicalProperties );
48
+ this .schemaCatalog = schemaCatalog ;
49
+ this .schemaDatabase = schemaDatabase ;
50
+ this .schemaTable = schemaTable ;
42
51
}
43
52
44
53
public PhysicalSchemaScan (RelationId id , TableIf table , List <String > qualifier ,
45
54
Optional <GroupExpression > groupExpression , LogicalProperties logicalProperties ,
46
- PhysicalProperties physicalProperties , Statistics statistics ) {
55
+ PhysicalProperties physicalProperties , Statistics statistics ,
56
+ Optional <String > schemaCatalog , Optional <String > schemaDatabase , Optional <String > schemaTable ) {
47
57
super (id , PlanType .PHYSICAL_SCHEMA_SCAN , table , qualifier , groupExpression ,
48
58
logicalProperties , physicalProperties , statistics );
59
+ this .schemaCatalog = schemaCatalog ;
60
+ this .schemaDatabase = schemaDatabase ;
61
+ this .schemaTable = schemaTable ;
62
+ }
63
+
64
+ public Optional <String > getSchemaCatalog () {
65
+ return schemaCatalog ;
66
+ }
67
+
68
+ public Optional <String > getSchemaDatabase () {
69
+ return schemaDatabase ;
70
+ }
71
+
72
+ public Optional <String > getSchemaTable () {
73
+ return schemaTable ;
49
74
}
50
75
51
76
@ Override
@@ -61,28 +86,53 @@ public <R, C> R accept(PlanVisitor<R, C> visitor, C context) {
61
86
@ Override
62
87
public Plan withGroupExpression (Optional <GroupExpression > groupExpression ) {
63
88
return new PhysicalSchemaScan (relationId , getTable (), qualifier ,
64
- groupExpression , getLogicalProperties (), physicalProperties , statistics );
89
+ groupExpression , getLogicalProperties (), physicalProperties , statistics ,
90
+ schemaCatalog , schemaDatabase , schemaTable );
65
91
}
66
92
67
93
@ Override
68
94
public Plan withGroupExprLogicalPropChildren (Optional <GroupExpression > groupExpression ,
69
95
Optional <LogicalProperties > logicalProperties , List <Plan > children ) {
70
96
return new PhysicalSchemaScan (relationId , getTable (), qualifier ,
71
- groupExpression , logicalProperties .get (), physicalProperties , statistics );
97
+ groupExpression , logicalProperties .get (), physicalProperties , statistics ,
98
+ schemaCatalog , schemaDatabase , schemaTable );
72
99
}
73
100
74
101
@ Override
75
102
public PhysicalPlan withPhysicalPropertiesAndStats (PhysicalProperties physicalProperties ,
76
103
Statistics statistics ) {
77
104
return new PhysicalSchemaScan (relationId , getTable (), qualifier ,
78
- groupExpression , getLogicalProperties (), physicalProperties , statistics );
105
+ groupExpression , getLogicalProperties (), physicalProperties , statistics ,
106
+ schemaCatalog , schemaDatabase , schemaTable );
79
107
}
80
108
81
109
@ Override
82
110
public String toString () {
83
111
return Utils .toSqlString ("PhysicalSchemaScan" );
84
112
}
85
113
114
+ @ Override
115
+ public boolean equals (Object o ) {
116
+ if (this == o ) {
117
+ return true ;
118
+ }
119
+ if (o == null || getClass () != o .getClass ()) {
120
+ return false ;
121
+ }
122
+ if (!super .equals (o )) {
123
+ return false ;
124
+ }
125
+ PhysicalSchemaScan that = (PhysicalSchemaScan ) o ;
126
+ return Objects .equals (schemaCatalog , that .schemaCatalog )
127
+ && Objects .equals (schemaDatabase , that .schemaDatabase )
128
+ && Objects .equals (schemaTable , that .schemaTable );
129
+ }
130
+
131
+ @ Override
132
+ public int hashCode () {
133
+ return Objects .hash (super .hashCode (), schemaCatalog , schemaDatabase , schemaTable );
134
+ }
135
+
86
136
@ Override
87
137
public boolean canPushDownRuntimeFilter () {
88
138
// currently be doesn't support schema scan rf
0 commit comments