-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
398 additions
and
275 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
flint-commons/src/main/scala/org/apache/spark/sql/QueryResultWriter.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.apache.spark.sql | ||
|
||
import org.opensearch.flint.data.FlintStatement | ||
|
||
trait QueryResultWriter { | ||
def write(dataFrame: DataFrame, flintStatement: FlintStatement): Unit | ||
} |
25 changes: 25 additions & 0 deletions
25
flint-commons/src/main/scala/org/apache/spark/sql/SessionManager.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.apache.spark.sql | ||
|
||
import org.opensearch.flint.data.{FlintStatement, InteractiveSession} | ||
|
||
import org.apache.spark.sql.SessionUpdateMode.SessionUpdateMode | ||
|
||
trait SessionManager { | ||
def getSessionManagerMetadata: Map[String, Any] | ||
def getSessionDetails(sessionId: String): Option[InteractiveSession] | ||
def updateSessionDetails( | ||
sessionDetails: InteractiveSession, | ||
updateMode: SessionUpdateMode): Unit | ||
def hasPendingStatement(sessionId: String): Boolean | ||
def recordHeartbeat(sessionId: String): Unit | ||
} | ||
|
||
object SessionUpdateMode extends Enumeration { | ||
type SessionUpdateMode = Value | ||
val Update, Upsert, UpdateIf = Value | ||
} |
15 changes: 15 additions & 0 deletions
15
flint-commons/src/main/scala/org/apache/spark/sql/StatementManager.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.apache.spark.sql | ||
|
||
import org.opensearch.flint.data.FlintStatement | ||
|
||
trait StatementManager { | ||
def prepareCommandLifecycle(): Either[String, Unit] | ||
def initCommandLifecycle(sessionId: String): FlintStatement | ||
def closeCommandLifecycle(): Unit | ||
def updateCommandDetails(commandDetails: FlintStatement): Unit | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.