Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 76: preserve column order from the columns option #77

Merged
merged 1 commit into from
May 15, 2019

Conversation

JulienPeloton
Copy link
Member

This PR fixes the wrong column ordering when the option columns was used:

df = spark.read.format("fits")\
  .option("hdu", 1)\
  .load("src/test/resources/test_file.fits")

df.show(2)
# +----------+--------+-------------------+-----+-----+
# |    target|      RA|                Dec|Index|RunId|
# +----------+--------+-------------------+-----+-----+
# |NGC0000000|3.448297|-0.3387486324784641|    0|    1|
# |NGC0000001|4.493667|-1.4414990980543227|    1|    1|
# +----------+--------+-------------------+-----+-----+

df = spark.read.format("fits")\
  .option("hdu", 1)\
  .option("columns", "Index,target,RunId")
  .load("src/test/resources/test_file.fits")

df.show(2)
# +-----+----------+-----+
# |Index|    target|RunId|
# +-----+----------+-----+
# |    0|NGC0000000|    1|
# |    1|NGC0000001|    1|
# +-----+----------+-----+

@JulienPeloton JulienPeloton added bug Something isn't working header labels May 14, 2019
@codecov-io
Copy link

codecov-io commented May 14, 2019

Codecov Report

Merging #77 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #77      +/-   ##
==========================================
+ Coverage   90.22%   90.24%   +0.01%     
==========================================
  Files           9        9              
  Lines         532      533       +1     
  Branches       99      101       +2     
==========================================
+ Hits          480      481       +1     
  Misses         52       52
Impacted Files Coverage Δ
...m/astrolabsoftware/sparkfits/FitsHduBintable.scala 93.05% <100%> (+0.09%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7aa656b...b299cdd. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working header
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants