MCPcopy Create free account
hub / github.com/featureform/featureform / InitializeExecutor

Method InitializeExecutor

provider/spark.go:944–967  ·  view source on GitHub ↗
(store SparkFileStore)

Source from the content-addressed store, hash-verified

942}
943
944func (s *SparkGenericExecutor) InitializeExecutor(store SparkFileStore) error {
945 s.logger.Info("Uploading PySpark script to filestore")
946 // We can't use CreateFilePath here because it calls Validate under the hood,
947 // which will always fail given it's a local file without a valid scheme or bucket, for example.
948 sparkLocalScriptPath := &filestore.LocalFilepath{}
949 if err := sparkLocalScriptPath.SetKey(config.GetSparkLocalScriptPath()); err != nil {
950 return fmt.Errorf("could not create local script path: %v", err)
951 }
952
953 sparkRemoteScriptPath, err := store.CreateFilePath(config.GetSparkRemoteScriptPath())
954 if err != nil {
955 return fmt.Errorf("could not create file path: %v", err)
956 }
957
958 err = readAndUploadFile(sparkLocalScriptPath, sparkRemoteScriptPath, store)
959 if err != nil {
960 return fmt.Errorf("could not upload '%s' to '%s': %v", sparkLocalScriptPath.Key(), sparkRemoteScriptPath.ToURI(), err)
961 }
962 scriptExists, err := store.Exists(sparkRemoteScriptPath)
963 if err != nil || !scriptExists {
964 return fmt.Errorf("could not upload spark script: Path: %s, Error: %v", sparkRemoteScriptPath.ToURI(), err)
965 }
966 return nil
967}
968
969func (s *SparkGenericExecutor) getYarnCommand(args string) (string, error) {
970 configDir, err := os.MkdirTemp("", "hadoop-conf")

Callers

nothing calls this directly

Calls 8

GetSparkLocalScriptPathFunction · 0.92
GetSparkRemoteScriptPathFunction · 0.92
readAndUploadFileFunction · 0.85
SetKeyMethod · 0.65
CreateFilePathMethod · 0.65
KeyMethod · 0.65
ToURIMethod · 0.65
ExistsMethod · 0.65

Tested by

no test coverage detected