0

I am very new to spark. Please help me with below query:

Suppose I have different file path in dev and prod and i do not want to hardcode the same in my spark scala code rather I want to use variable in my code so my doubt is that where I define these variables for dev and prod and how to access them in my code.

1 Answer 1

0

Here are a few options:

  • Pass variables as command line parameters to your Spark application
  • Use the property/config file to keep those variables
  • Create environmental variables for these variables

For implementation, follow these articles.

Sign up to request clarification or add additional context in comments.

2 Comments

@vikramsinhThanks for the response, it would be very helpful if you share how to set env variable for the variables and use them in the application or share some reference
Updated the answer to include a few useful links

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.